Consider the following snippet:
public class ReflectionTest {
public static void main(String[] args) {
ReflectionTest test = new ReflectionTest
The easy way to do this is via java.beans.Statement or java.beans.Expression. Does all these hard yards for you.
getMethod() is obviously unaware that a String could be fed to a method that expects an Object
'Unaware' is a strange way to put it. getMethod()
adheres to its specification. You have to supply the formal parameters, not the types of the actual arguments.