As far as I can tell the logic is all there..
package com.codegym.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/*
Kind Emma and the summer holidays
*/
public class Solution {
public static HashMap<String, Date> createMap() throws ParseException {
DateFormat df = new SimpleDateFormat("MMMMM d yyyy", Locale.ENGLISH);
HashMap<String, Date> map = new HashMap<String, Date>();
map.put("Stallone", df.parse("JUNE 1 1980"));
//write your code here
map.put("Jon", df.parse("APRIL 8 2001"));
map.put("Roy", df.parse("MARCH 8 2001"));
map.put("Silver", df.parse("JULY 8 2001"));
map.put("Loner", df.parse("JUNE 8 2001"));
map.put("Friend", df.parse("JANUARY 8 2001"));
map.put("Fanny", df.parse("NOVEMBER 8 2001"));
map.put("John", df.parse("OCTOBER 8 2001"));
map.put("Phil", df.parse("DECEMBER 8 2001"));
map.put("Julia", df.parse("FEBRUARY 8 1977"));
return map;
}
public static void removeAllSummerPeople(HashMap<String, Date> map) throws ParseException {
//write your code here
Iterator<Map.Entry<String, Date>> iter = map.entrySet().iterator();
DateFormat df = new SimpleDateFormat("MMMMM d", Locale.ENGLISH);
Date startDate = df.parse("MAY 31");
Date endDate = df.parse("SEPTEMBER 1");
while(iter.hasNext()){
Map.Entry<String, Date> entry = iter.next();
Date n = entry.getValue();
if(startDate.after(n) && endDate.before(n)){
iter.remove();
}
}
}
public static void main(String[] args) {
}
}