Can someone please help
package com.codegym.task.task08.task0817;
import java.util.*;
/*
We don't need repeats
*/
public class Solution {
public static HashMap<String, String> createMap() {
HashMap<String, String> hmap = new HashMap<>();
hmap.put("A","K");
hmap.put("B","L");
hmap.put("C","M");
hmap.put("D","K");
hmap.put("E","O");
hmap.put("F","P");
hmap.put("G","K");
hmap.put("H","R");
hmap.put("I","S");
hmap.put("J","K");
return hmap;
}
public static void removeFirstNameDuplicates(Map<String, String> map) {
//Map<String, String> map = new HashMap<String>();
Iterator<Map.Entry<String, String>> entries = map.entrySet().iterator();
while (entries.hasNext()) {
entries.next();
removeItemFromMapByValue(map, (entries.next()).getValue());
}
}
public static void removeItemFromMapByValue(Map<String, String> map, String value) {
HashMap<String, String> copy = new HashMap<String, String>(map);
for (Map.Entry<String, String> pair : copy.entrySet()) {
if (pair.getValue().equals(value))
map.remove(pair.getKey());
}
}
public static void main(String[] args) {
}
}