//
// Sorts a list of strings alphabetically
// Comparator in sorted() can be replaced based on the type of your list
//
List<String> names = List.of("Nikos", "Sofia", "Klelia", "George");
// [Nikos, Sofia, Klelia, George]
List<String> sortedList = names.stream()
.sorted((o1, o2) -> Collator.getInstance().compare(o1, o2))
.collect(Collectors.toList());
// [George, Klelia, Nikos, Sofia]