How exactly do you chain method references for instances with Java 8? Example:
Collections.sort(civs,Comparator.comparing(Civilization::getStrategy.getStrategLevel));
getStrategy
of a Civilization
instance returns a Strategy
object instance which has the instance method getStrategyLevel
.
Why doesn't the Comparator.comparing
method return a comparator with it's functional interface implemented by the lambda expression?