I am trying to get the key with maximum number of values (not max value). I ave tried a couple of thing like counting values iterating over each key. But they boil down to problem finding a key from value which is problematic when we have same values.
// calculate the length
for(String key : map.keySet())
{
len.add(map.get(key).size());
}
// sort the length
Collections.sort(len, Collections.reverseOrder() );