I am trying to do this
First I have an interface like this:
public void doSomething (String input, MyClass myMethod);
and at the implementation I had
public void doSomething (String input, MyClass myMethod){
myMethod.mySpecificMethod(input2);
}
So now I was checking the java.util.function class and I found out that there is a FunctionalInterface Function.
So far I just try to replace MyClass myMethod with this Function but Im sure there are better ways (also this doesnt work).
Any idea how to? When using generics later I cannot invoke my method, should I just cast the generic to the desired class?