I want to write a comparator that will let me sort a TreeMap by value instead of the default natural ordering.
I tried something like this, but can\'t find out what
This can't be done by using a Comparator, as it will always get the key of the map to compare. TreeMap can only sort by the key.
Comparator
TreeMap