не проходит последний пункт, пробовал в remove распечатать и вызвать в main, и сработало корректно, но валидатор не пропускает
package com.javarush.task.task08.task0818;
import java.util.Map;
import java.util.*;
/*
Только для богачей
*/
public class Solution {
public static Map<String, Integer> createMap() {
//напишите тут ваш код
Map<String, Integer> map = new HashMap<>();
map.put("Иванов", 400);
map.put("Петров", 1400);
map.put("Сидоров", 450);
map.put("Алексеев", 2400);
map.put("Сергеев", 2500);
map.put("Николаев", 4500);
map.put("Гуляев", 200);
map.put("Стояев", 300);
map.put("Сидяев", 4600);
map.put("Лежаев", 1000);
return map;
}
public static void removeItemFromMap(HashMap<String, Integer> map) {
Iterator<Map.Entry<String, Integer>> iterator = map.entrySet().iterator();
while (iterator.hasNext()){
Map.Entry<String, Integer> pair = iterator.next();
String key = pair.getKey();
Integer value = pair.getValue();
if(value < 500)
iterator.remove();
}
}
public static void main(String[] args) {
}
}