I have generic classes that look like:
interface X<Input, Output>
{
Output process(Input input);
}
class Y implements X<Integer, Float>
{
Float process(Integer input);
}
I use getDeclaredMethods to find process on Y just with its name (not the arguments, on purpose). When I look at the return Method[], process shows up twice, with Input=Object, Output=Object, and then with the actual instantiation types: Integer and Float.
Please note: I can see 1 function with Object,Object in the Method[] AND 1 function with the actual types I use to instantiate, like Integer,Float. So, the second function, which I'm interested in, is accessible from Method[].
What is the best way to get only the method with the actual types?