I have a client.class that uses Util.class to invoke a method on target.class. The invocation is forced by calling the setAccessible(true) to the method of target.class.
Question: Is there a way to have this Util.class determine if the client.class has access to this particular method of target.class?
I want to skip having to use the method setAccessible(true). client.class has access to the method I am invoking in target.class, but Util.class does not have access because the method is protected or default.