Edit : this question is distorted to such an extent that I cannot fix it, and this is a mistake somewhere in my project. The main reason for my problem is that myLambda.getClass () should not throw a ClassNotFoundException, and the lambda works as expected.
Given the interface class
Class myIf = MyIf.class;
And an instance of lambda
Object myLambda;
How to determine if myLambda can be assigned MyIf without exception exception? This is a bit perplexing since myLambda.getClass () throws an exception. And the "obvious"
myIf.isInstance(myLambda)
returns false
source share