@ParameterizedTest
  @MethodSource("mappers")
  void immutable(ObjectMapper mapper) throws JsonProcessingException {
    // write
    ImmutablePerson person = new PersonGenerator().next().withId("id123");
    ObjectNode node = mapper.valueToTree(person);
    check(node.get("_id").asText()).is("id123");
    check(ImmutableList.copyOf(node.fieldNames())).not().has("id");

    check(mapper.treeToValue(node, Person.class).id()).is("id123");
    check(mapper.treeToValue(node, ImmutablePerson.class).id()).is("id123");
  }
Check annotation lookup for java beans
criteria/mongo/test/org/immutables/criteria/mongo/bson4jackson/IdAnnotationModuleTest.java