I don't know how can best describe my problem but here it is, I'm trying to remove the same names(values) from HashMap<String, String> map = new HashMap<String, String>();
for example if this map contain names like
map.put("Vivaldi","Antonio");
map.put("Belucci", "Monica");
map.put("Gudini", "Harry");
map.put("Verdo", "Dhuzeppe");
map.put("Maracci", "Bruno");
map.put("Carleone", "Vito");
map.put("Bracco", "Luka");
map.put("Stradivari", "Antonio");
I want to remove all entries with the value "Antonio" from it by using method removeTheFirstNameDuplicates
, I looked in Google for a couple of days and all examples are close to what I want but not really what I need.
My thoughts are, I need something that will check a map and if it contains the same values in it then remove the duplicate. But how can I do this?