@Test
  void fromAnnotation() {
    KeyExtractor extractor = KeyExtractor.fromAnnotation(MyAnnotation.class).create(WithAnnotation.class);

    check(extractor.metadata().keys()).hasSize(1);
    Member member = (Member) Visitors.toPath(extractor.metadata().keys().get(0)).element();
    check(member.getName()).is("id123");
    check(extractor.extract(new WithAnnotation("foo"))).is("foo");
  }
Check that annotation name is exposed in error message
criteria/common/test/org/immutables/criteria/backend/KeyExtractorTest.java