I have a TreeMap with entries like
["aftab" = 4, "Manoj" = 5, "Rahul" = 5]
I want to get the key with the max value, but if there are two or more max values I want the key that comes first in the map, Manoj in this case. In My application I used Collections.max(map.getKey()) and it is returning Rahul.