1ArrayList<Employee> employees = getUnsortedEmployeeList();
2
3Comparator<Employee> compareById = (Employee o1, Employee o2) -> o1.getId().compareTo( o2.getId() );
4
5Collections.sort(employees, compareById);
6
7Collections.sort(employees, compareById.reversed());