Here's one way of doing it assuming you have equals
and hashcode
methods implemented in the User class properly.
Set uniqueUsers = new HashSet<>(users);
Set sortedUniqueUsers = uniqueUsers.stream()
.sorted(Comparator.comparingInt(User::getAge))
.collect(Collectors.toSet());