@Test
  public void setListNonScalar() throws Exception {
    String id = "i1";
    ImmutableItem item = ImmutableItem.builder().id(id).addList("l1").addTags(ImmutableTag.of("t1")).build();

    check(repository.upsert(item).getUnchecked()).is(1);

    repository.update(repository.criteria().id(id))
        .setTags(Collections.<Item.Tag>emptyList())
        .updateFirst()
        .getUnchecked();

    check(findById(id).tags()).isEmpty();

    Set<Item.Tag> set1 = Collections.<Item.Tag>singleton(ImmutableTag.of("t2"));
    repository.update(repository.criteria().id(id))
        .setTags(set1)
        .updateFirst()
        .getUnchecked();

    check(findById(id).tags()).hasAll(set1);

    List<? extends Item.Tag> set2 = Arrays.asList(ImmutableTag.of("t3"), ImmutableTag.of("t4"));

    repository.update(repository.criteria().id(id))
        .setTags(set2)
        .updateFirst()
        .getUnchecked();

    check(findById(id).tags()).hasAll(set2);
  }
{@code $set} functionality but on a non-scalar Object
mongo/test/org/immutables/mongo/fixture/SimpleUpdaterTest.java