Ulf Dittmer wrote:It is important to realize that a Map has no sort order.
The SortedMap interface, and its implementation TreeMap, disagree with you
However, these only impose an order on the keys, not on the values. There is no known implementation that sorts on the values, and the reason is clear: it basically turns your Map into a list of Map.Entry objects as far as performance goes. get() looks up values based on a key, and if the Map is sorted on the value the Map will have to check every entry until a match is found.
Of course, if you really need this, you can implement it yourself: