Is
test::testMethod == test::testMethod
true? I want to find out whether they will refer to the same object. This code does not compile. But there may be several situations in which this needs clarification.
I suspect that this will expand to
Runnable r = () -> test.testMethod()
Runnable r1 = () -> test.testMethod()
And whether the below is true.
r == r1
trueor not is meaningless. Please provide a complete example that does compile.true, but doesn’t have to. And in the current JRE, it isn’t. You may also retrace the test of this answer which shows, under which circumstances the objects are the same in the current implementation.