Как проверить эту программу? я в мейне создал мап = createMap()...присваивание не получается.
package com.javarush.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/*
Добрая Зинаида и летние каникулы
*/
public class Solution {
public static Map<String, Date> createMap() throws ParseException {
DateFormat dateFormat = new SimpleDateFormat("MMMMM d yyyy", Locale.ENGLISH);
Map<String, Date> map = new HashMap<>();
map.put("Сталлоне", dateFormat.parse("MAY 1 2012"));
map.put("Сталлон", dateFormat.parse("MAY 1 2012"));
map.put("Сталло", dateFormat.parse("MAY 1 2012"));
map.put("Сталл", dateFormat.parse("MAY 1 2012"));
map.put("Стал", dateFormat.parse("MAY 1 2012"));
map.put("Ста", dateFormat.parse("MAY 1 2012"));
map.put("Сталлп", dateFormat.parse("MAY 1 2012"));
map.put("Сталлоные", dateFormat.parse("MAY 1 2012"));
map.put("Сталлофне", dateFormat.parse("MAY 1 2012"));
map.put("Сталловне", dateFormat.parse("MAY 1 2012"));
return map;
}
public static void removeAllSummerPeople(Map<String, Date> map) {
Map<String, Date> copy = new HashMap<>(map);
Iterator<Map.Entry<String, Date>> iterator = copy.entrySet().iterator();
while (iterator.hasNext()){
if(iterator.next().getValue().getMonth() > 6 && iterator.next().getValue().getMonth() < 9){
iterator.remove();}
}
}
public static void main(String[] args) {
}
}