@Test
  public void setList() throws Exception {
    String id = "i1";

    check(overrideList(id, Collections.singleton("BAD"))).is(0);

    ImmutableItem item = ImmutableItem.builder().id(id).addList("l1").build();

    check(repository.upsert(item).getUnchecked()).is(1);
    check(findById(id).list()).hasAll("l1");

    overrideList(id, Collections.<String>emptyList());
    check(findById(id).list()).isEmpty();

    overrideList(id, Collections.singleton("l2"));
    check(findById(id).list()).hasAll("l2");

    overrideList(id, Arrays.asList("l3", "l4", "l5"));
    check(findById(id).list()).hasAll("l3", "l4", "l5");
  }
Checks {@code $set} functionality of the repository
mongo/test/org/immutables/mongo/fixture/SimpleUpdaterTest.java