I was trying to filter a list based on multiple conditions, sorting.
class Student{ private int Age; private String className; privat
Or without streams:
Map map = new HashMap<>(); students.forEach(x -> map.merge(x.getName(), x, (oldV, newV) -> oldV.getAge() > newV.getAge() ? oldV : newV)); Collection max = map.values();