I've got names in an ArrayList , and I would like to find the most common element in the simplest way. I tried to use Collectoins.max() , but it's return value was incorrect.
I created a HashMap, using names az Keys and quantity of names as Values, but I couldn't figure out how to write the names with the highest values.
( Actually, if there is two or more names with highest values, I have to get all of them. )