I want to sort a list with Lambda:
List messagesByDeviceType = new ArrayList(); messagesByDeviceType.sort((Message o1, Messag
Comparator#compareTo returns an int; while getTime is obviously long.
Comparator#compareTo
int
getTime
long
It would be nicer written like this:
.sort(Comparator.comparingLong(Message::getTime))