I'm trying to invoke a method that takes a super class as a parameter with subclasses in the instance.
public String methodtobeinvoked(Collection<String> collection);
Now if invoke via
List<String> list = new ArrayList();
String methodName = "methodtobeinvoked";
...
method = someObject.getMethod(methodName,new Object[]{list});
It will fail with a no such method Exception
SomeObject.methodtobeinvoked(java.util.ArrayList);
Even though a method that can take the parameter exists.
Any thoughts on the best way to get around this?