Comparator.comparing()
.
Some comparators like (person1, person2) -> person1.getName().compareTo(person2.getName())
could be simplified like this: Comparator.comparing(Person::getName)
.
Also suggests to replace chain comparisons with Comparator.thenComparing(), e.g.
int res = o1.first.compareTo(o2.first);
if(res == 0) res = o1.second.compareTo(o2.second);
if(res == 0) res = o1.third - o2.third;
return res;
will be replaced with
objs.sort(Comparator.comparing((Obj o) -> o.first).thenComparing(o -> o.second).thenComparingInt(o -> o.third));
New in 2016.3