My program is not fulfilling last condition. Please tell whats the error.
package com.codegym.task.task08.task0818;
import java.util.*;
import java.util.HashMap;
import java.util.Map;
/*
Only for the rich
*/
public class Solution {
public static HashMap<String, Integer> createMap() {
HashMap<String,Integer> a =new HashMap<String,Integer>();//write your code here
a.put("A" ,1000);
a.put("B" ,500);
a.put("c", 400);
a.put("d" ,10000);
a.put("f" ,100);
a.put("e", 6000);
a.put("g", 200);
a.put("h", 10500);
a.put("i", 8000);
a.put("j" ,9000);
return a;
}
public static void removeItemFromMap(HashMap<String, Integer> map) {
HashMap<String,Integer> aa =new HashMap<String,Integer>(map); //write your code here
Iterator<Map.Entry<String,Integer>> p= aa.entrySet().iterator();
while(p.hasNext()){
Map.Entry<String,Integer> b= p.next();
Integer c= b.getValue();
if(c<500) {
p.remove();
}
}
}
public static void main(String[] args) {
}
}