3 ms·
Java 8 also has `Comparator::comparing` and `Comparator::thenComparing`, so your code example above would be Comparator.comparing(Foo::getA). thenC
by tpxl 9y ago
Java 8 also has `Comparator::comparing` and `Comparator::thenComparing`, so your code example above would be
Comparator.comparing(Foo::getA).
thenComparing(Foo::getB).
thenComparign(Foo::getC);
This makes much more sense than your example I think, since it will use the same getter on both methods, completely eliminating this class of errors.
- deleted 9y ago[deleted]