I want to sort a copy of an immutableList by descending string length. I have to support API below java 8.
I try this basic code, but it's still in reverse order
ImmutableList<String> possibleTexts = ImmutableList.of("aa", "bbbbbb");
final List<String> mutableList = new ArrayList<>(possibleTexts);
Collections.sort(mutableList, (s1, s2) -> Math.abs(s1.length() - s2.length()));
and yet mutableList is "aa", "bbbbbb" instead of "bbbbbb","aa"