@Test
  void instant() {
    InstantHolderRepository repository = new InstantHolderRepository(backend);
    Instant value = Instant.now();
    ImmutableInstantHolder holder = TypeHolder.InstantHolder.generator().get().withValue(value).withOptional(value).withNullable(null);
    repository.insert(holder);
    BsonDocument doc = fetch();

    BsonDateTime expected = new BsonDateTime(value.toEpochMilli());
    check(doc.get("value")).is(expected);
    check(doc.get("optional")).is(expected);
    if (doc.containsKey("nullable")) {
      check(doc.get("nullable")).is(BsonNull.VALUE);
    }
  }
Check correct serialization of {@code java.time.*} types like {@link LocalDate}
criteria/mongo/test/org/immutables/criteria/mongo/JavaTimeTypeTest.java