Created
July 18, 2020 20:35
-
-
Save theboreddev/298f3da0a326da33022b0dc97e549343 to your computer and use it in GitHub Desktop.
youngestEmployeeBySex
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
final Map<Employee.Sex, Optional<Employee>> youngestEmployeeBySex = employees.stream() | |
.collect(groupingBy(Employee::getSex, minBy(comparing(Employee::getAge)))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment