@Test
  void insert() {
    WriteResult result = repository.insert(generator.next());
    check(result.insertedCount().getAsLong()).is(1L);
    check(result.deletedCount().getAsLong()).is(0L);
    check(result.updatedCount().getAsLong()).is(0L);

    WriteResult result2 = repository.insertAll(ImmutableList.of(generator.next(), generator.next()));
    check(result2.insertedCount().getAsLong()).is(2L);
    check(result2.deletedCount().getAsLong()).is(0L);
    check(result2.updatedCount().getAsLong()).is(0L);
  }
Validate results of a mongo write operation with {@link WriteResult}.
criteria/mongo/test/org/immutables/criteria/mongo/MongoWriteResultTest.java