java 8 sort list ascending descending code example Example: java stream sorted reverse list.stream().sorted(Comparator.reverseOrder())