Check out example codes for "java stream sort". It will help you in understanding the concepts better.

Code Example 1

List<String> sorted = original.stream().sorted().collect(Collectors.toList());

Learn ReactJs, React Native from akashmittal.com