The new RuntimeHints API allows to describe hints for the reflection/proxies/resources needs at runtime. The problem is, a single invocation at runtime can be covered by multiple, different hints.

For example, reflection introspection on the myMethod method for the class MyClass can be covered by any of:

  • MemberCategory.INTROSPECT_PUBLIC_METHODS if myMethod is public
  • MemberCategory.INVOKE_PUBLIC_METHODS if myMethod is public
  • MemberCategory.INTROSPECT_DECLARED_METHODS in all cases
  • MemberCategory.INVOKE_DECLARED_METHODS in all cases
  • a specific introspection or invokation reflection entry for MyClass::myMethod

Because of the knowledge required for checking if registered hints are enough for a particular use case, we should introduce Predicate<RuntimeHints> static utilities to be used in tests and in #27981