Answers found at Java 8 lambdas, Function.identity() or t->t seem to imply that Function.identity()
is almost always equivalent to t -> t
. Howeve
Ecj is able to infere the correct(?) type argument (Integer) to match the constraints. Javac for some reason comes to a different result.
Thats not the first time javac/ecj behave differently in inference of type parameters.
In that case you can give javac a hint with Function.
For the difference between Function.identity() and t->t:
So t->t is more flexible in the methods it can match to.