sort a list using comparator java 8 code example
Example 1: lambda comparator java
Comparator<Developer> byName =
(Developer o1, Developer o2)->o1.getName().compareTo(o2.getName());
Example 2: java stream sort Collator
Collator coll = Collator.getInstance(new Locale("tr","TR"));
coll.setStrength(Collator.PRIMARY);
List<AClass> sorted = names.stream()
.sorted(Comparator.comparing(AClass::getName,coll))
.collect(Collectors.toList());