How can I sort by property using a collator ? (Java)
问题 (I use Java) I want to sort a sublist of objects by a property using a Collator so that is sorted by alphabetical order but ignoring accents. Problem is I have tried different things and none work. This sorts the sublists but doesn't ignore accents: newList.subList(0, 5).sort(Comparator.comparing(element -> element.getValue())); This is the collator I want to use: Collator spCollator = Collator.getInstance(new Locale("es", "ES")); I expect the output to be a sublist sorted by alphabetical