Inspectopedia Help

Comparator method can be simplified

Reports Comparator combinator constructs that can be simplified.


c.thenComparing(Comparator.comparing(function)); Comparator.comparing(Map.Entry::getKey); Collections.max(list, Comparator.reverseOrder());

After the quick-fixes are applied:

c.thenComparing(function) Map.Entry.comparingByKey() Collections.min(list, Comparator.naturalOrder());

New in 2018.1

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023