-
-
Save iyengarajay/0cd0de658106a27ae78b6cdcd8b6b362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collections.sort(teens, | |
Comparator.comparing(Teenager::getAge) | |
.thenComparing(Teenager::getPhoneBrand,Comparator.nullsLast(Comparator.naturalOrder()))); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment