@Test
  public void withDate() {
    final Date date = new Date();
    final ObjectId id = ObjectId.get();
    final Jackson expected = ImmutableJackson.builder()
            .id(id)
            .prop1("prop1")
            .prop2("22")
            .date(new Date(date.getTime()))
            .build();

    repository.insert(expected).getUnchecked();

    check(collection.countDocuments()).is(1L);

    final Jackson actual = repository.findAll().fetchAll().getUnchecked().get(0);
    check(expected).is(actual);

    final BsonDocument doc = collection.find().first();
    check(doc.keySet()).hasContentInAnyOrder("_id", "prop1", "prop2", "date", "uuid");
    check(doc.get("date").asDateTime().getValue()).is(date.getTime());
    check(doc.get("_id").asObjectId().getValue()).is(id);
  }
Tests for repository using <a href="https://github.com/FasterXML/jackson">Jackson</a> library.
@see JacksonCodecs
mongo/test/org/immutables/mongo/fixture/JacksonRepoTest.java