How can I suffice the last requirement?
package com.codegym.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Locale;
import java.util.Map;
/*
Kind Emma and the summer holidays
*/
public class Solution {
public static HashMap<String, Date> createMap() throws ParseException {
DateFormat df = new SimpleDateFormat("MMMM d yyyy", Locale.ENGLISH);
HashMap<String, Date> map = new HashMap<String, Date>();
map.put("Stallone", df.parse("JUNE 1 1980"));
map.put("Julie", df.parse("JULY 9 2002"));
map.put("Auggy", df.parse("AUGUST 16 2017"));
map.put("Sephie", df.parse("SEPTEMBER 18 2008"));
map.put("Octan", df.parse("OCTOBER 2 2004"));
map.put("Novem", df.parse("NOVEMBER 19 1994"));
map.put("Decca", df.parse("DECEMBER 12 2000"));
map.put("Jan", df.parse("JANUARY 7 1990"));
map.put("Febe", df.parse("FEBRUARY 6 2011"));
map.put("Mar", df.parse("MARCH 5 1988"));
return map;
//write your code here
}
public static void removeAllSummerPeople(HashMap<String, Date> map) throws ParseException{
//write your code here
DateFormat df = new SimpleDateFormat("MMMM", Locale.ENGLISH);
Date a = df.parse("JUNE");
Date b = df.parse("JULY");
Date c = df.parse("AUGUST");
for(Map.Entry<String, Date> pair : map.entrySet()){
Date date = pair.getValue();
if(date.getMonth()==a.getMonth()||date.getMonth()==b.getMonth()||date.getMonth()==c.getMonth()){
map.remove(pair.getValue());
map.remove(pair.getKey());
}
}
}
public static void main(String[] args){
}
}