Вот уже совсем не знаю что делать... Как только не шаманил - не прокатывает..
package com.javarush.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.io.*;
/*
Добрая Зинаида и летние каникулы
*/
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("JUNE 2 2080"));
map.put("Дикаприо", dateFormat.parse("MART 3 8912"));
map.put("Кек", dateFormat.parse("SEPTEMBER 4 9012"));
map.put("Лол", dateFormat.parse("MAY 5 2012"));
map.put("Орбидол", dateFormat.parse("MAY 6 2112"));
map.put("Чебурек", dateFormat.parse("MAY 7 2212"));
map.put("Шаурма", dateFormat.parse("MAY 8 2312"));
map.put("Окунь", dateFormat.parse("MAY 9 2412"));
map.put("Зинаида", dateFormat.parse("MAY 10 2512"));
return map;
}
public static void removeAllSummerPeople(Map<String, Date> map) {
Iterator<Map.Entry<String, Date>> it = map.entrySet().iterator();
while(it.hasNext()){
Map.Entry<String, Date> pair = it.next();
Date DMonth = pair.getValue();
int month = DMonth.getMonth();
if(month == 7){map.remove(pair.getKey());}
if(month == 6){map.remove(pair.getKey());}
if(month == 5){map.remove(pair.getKey());}
}
}
public static void main(String[] args) {
}
}