Ok this is a tricky one. I have a list of Sets. I would like to sort the objects in the Sets in an order.
Imagine each set as repressenting a class in a school. Each
With Java 8 you can sort the Set of persons and generate List of persons which are sorted as follows.
Set
List
List personList = personSet.stream().sorted((e1, e2) -> e1.getName().compareTo(e2.getName())).collect(Collectors.toList());