static List<ObjectMapper> mappers() {
    ObjectMapper template = new ObjectMapper()
            .registerModule(new Jdk8Module())
            .registerModule(new GuavaModule())
            .registerModule(new JavaTimeModule());

    ObjectMapper mapper1 = template.copy().registerModule(new IdAnnotationModule());
    ObjectMapper mapper2 = template.copy().registerModule(IdAnnotationModule.fromPredicate(m -> ((AnnotatedElement) m).isAnnotationPresent(Criteria.Id.class)));
    ObjectMapper mapper3 = template.copy().registerModule(IdAnnotationModule.fromAnnotation(Criteria.Id.class));
    return Arrays.asList(mapper1, mapper2, mapper3);
  }
Test that ID attributes are correctly identified
criteria/mongo/test/org/immutables/criteria/mongo/bson4jackson/IdAnnotationModuleTest.java