Whats wrong with my code?
package com.codegym.task.task08.task0818;
import java.util.HashMap;
import java.util.Map;
/*
Only for the rich
*/
public class Solution {
public static HashMap<String, Integer> createMap() {
//write your code here
HashMap<String, Integer> map = new HashMap<>();
map.put("Stallone", "1980");
map.put("Red", "2010");
map.put("FDAF", "500");
map.put("GESA", "2000");
map.put("GDSA", "2001");
map.put("HHK", "2002");
map.put("YTU", "2004");
map.put("YTIYT", "2003");
map.put("POHG","2007");
map.put("RHGF", "2010");
return map;
}
public static void removeItemFromMap(HashMap<String, Integer> map) {
//write your code here
Iterator <Map.Entry<String,Integer>> iterator = map.entrySet().iterator();
while (iterator.hasNext())
{
while(iterator.hasNext()){
Map.Entry<String, Integer> p= iterator.next();
int m=p.getValue().getMonth();
if(m<500){
iterator.remove();
}
}
}
}
public static void main(String[] args) {
}
}