In particular, some cascaded groupingBy
collectors can be expressed by using a
simpler toMap
collector, which is also likely to be more performant.
Example:
Collectors.groupingByConcurrent(String::length, Collectors.collectingAndThen(Collectors.maxBy(String::compareTo), Optional::get));
After the quick-fix is applied:
Collectors.toConcurrentMap(String::length, Function.identity(), BinaryOperator.maxBy(String::compareTo));
This inspection only reports if the language level of the project or module is 8 or higher.
New in 2017.1