Но на ПК все идеально
package com.javarush.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.util.*;
import java.text.SimpleDateFormat;
public class Solution
{
public static HashMap<String, Date> createMap() throws ParseException
{
DateFormat dateFormat = new SimpleDateFormat("MMMMM d yyyy", Locale.ENGLISH);
HashMap<String, Date> map = new HashMap<>();
map.put("Май1", dateFormat.parse("MAY 1 2012"));
map.put("Май2", dateFormat.parse("MAY 1 2012"));
map.put("Май3", dateFormat.parse("MAY 1 2012"));
map.put("Май4", dateFormat.parse("MAY 1 2012"));
map.put("Май5", dateFormat.parse("MAY 1 2012"));
map.put("Май6", dateFormat.parse("MAY 1 2012"));
map.put("Июль", dateFormat.parse("JULY 1 2012"));
map.put("Август", dateFormat.parse("AUGUST 1 2012"));
map.put("Июнь", dateFormat.parse("JUNE 1 2012"));
map.put("Май7", dateFormat.parse("MAY 1 2012"));
return map;
}
public static void removeAllSummerPeople(HashMap<String, Date> map)
{
ArrayList<String> list = new ArrayList<>();
for (Map.Entry<String,Date> pair :map.entrySet())
{
int a = pair.getValue().getMonth();
if (a>=5 && a<=7)
{
list.add(pair.getKey());
}
}
for (String i:list)
{
map.remove(i);
}
}
public static void main(String[] args) throws ParseException
{
removeAllSummerPeople(createMap());
}
}