For Ascending order keep we can just do by listName.sort() i.e the default behavior. For Descending order just need to pass the order i.e Comparator.reverseOrder() in the sorted method as an argument.