НЕ могу понять в чем ошибка!!!!
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"));
//String[] months = {"FEBRUARY", "MARCH", "APRIL", "MAY", "JUNE", "JULY", "AUGUST", "SEPTEMBER", "OCTOBER"};
/*for(int i = 1; i < 10; i++) {
//String value = months[i] + " " + i + " " + "201" + i;
map.put("Смирнов" + i, dateFormat.parse(months[i] + " " + i + " " + "2012"));
}
*/
map.put("Белуччи", dateFormat.parse("JUNE 1 1970"));
map.put("Альпачино", dateFormat.parse("JUNE 1 1970 "));
map.put("ДиКаприо", dateFormat.parse("SEPTEMBER 1 1970"));
map.put("Деймон", dateFormat.parse("DECEMBER 1 1970"));
map.put("Шварценнегер", dateFormat.parse("NOVEMBER 1 1970"));
map.put("Лайвли", dateFormat.parse("JULY 1 1970"));
map.put("Армостронг", dateFormat.parse("SEPTEMBER 1 1970"));
map.put("Энрике", dateFormat.parse("MARCH 1 1970"));
map.put("Кристофер", dateFormat.parse("AUGUST 1 1970"));
return map;
}
public static void removeAllSummerPeople(Map<String, Date> map) throws ParseException {
Iterator<Map.Entry<String, Date>> iterator = map.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, Date> pair = iterator.next();
// String key = pair.getKey();
Date month = pair.getValue();
if (month.equals("JUNE") || month.equals("JULY") || month.equals("AUGUST")) {
map.remove(pair.getKey());
}
}
/* Date june = dateFormat.parse("JUNE");
Date july = dateFormat.parse("JULY");
Date august = dateFormat.parse("AUGUST");
if (value.equals(june)||value.equals(july)||value.equals(august)) {
iterator.remove();
*/
}
/* map.entrySet().removeIf(entries->entries.getValue().equals("JUNE"));
map.entrySet().removeIf(entries->entries.getValue().equals("JULY"));
map.entrySet().removeIf(entries->entries.getValue().equals("AUGUST"));
for(Map.Entry<String, Date> pair : map.entrySet());
*/
/* Iterator<Map.Entry<String, Date>> iterator = map.entrySet().iterator();
for (Map.Entry<String, Date> entry: map.entrySet()){
if (entry.getValue().toString().subSequence(4,7).equals("JUNE") ||
entry.getValue().toString().subSequence(4,7).equals("JULY") ||
entry.getValue().toString().subSequence(4,7).equals("AUGUST")){
map.remove(entry.getKey());
if(pair.getValue().equals("JUNE") || pair.getValue().equals("JULY") || pair.getValue().equals("AUGUST")) {
map.remove(pair.getKey());
}
}
*/
/* for(int i = 1; i < 11; i++){
if(map.containsValue("JULY 1 1970", "AUGUST 1 1970" "JUNE 1 1970" ))
}
*/
// map.removeIf(n -> n > 10);
// if(map.get[i].equals("JUNE") || map.getValue().equals("JULY") || map.getValue().equals("AUGUST")) {
// map.remove(map.getKey());
public static void main(String[] args){
//createMap();
//removeAllSummerPeople(map);
}
}