@Test
  public void readWrite_single() throws Exception {
    Item item = ImmutableItem.builder()
        .id("1")
        .binary(Binary.create(new byte[] {1, 2, 3}))
        .build();

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

    List<Item> items = repository.find(repository.criteria().id("1")).fetchAll().getUnchecked();

    check(items).hasSize(1);
    check(items.get(0).id()).is("1");
    check(repository.findById("1").fetchAll().getUnchecked()).hasSize(1);
  }
Basic CRUD operations on the top of repository
mongo/test/org/immutables/mongo/fixture/BasicMongoOperationsTest.java