I have a HashMap defined like this...
HashMap uniqueNames = new HashMap();
It stor
List list= new ArrayList();
HashMap map=new HashMap();
for(String string: list)
{
if(map.containsKey(string))
{
map.put(string, map.get(string)+1);
}
else {
map.put(string, 1);
}
}
Entry maxEntry = null;
for(Entry entry : map.entrySet()) {
if (maxEntry == null || entry.getValue() > maxEntry.getValue()) {
maxEntry = entry;
}
}