And to simplify the question, is it possible for me to create some function
foo that can do this?

record User(String firstName, String lastName) {}
java.lang.reflect.Method getFirstName = foo(User::firstName);

Or better yet, like this?

java.lang.reflect.RecordComponent getLastName = foo(User::lastName);

Reply via email to