I'm at a loss on this one. It makes sense to me that the code should be working, but it doesn't. Your help is appreciated.
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.*;
import java.io.*;
/*
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("Stallone1", df.parse("JUNE 1 1980"));
map.put("Mary", df.parse("AUGUST 1 1980"));
map.put("Maxne", df.parse("JUNE 1 1980"));
map.put("Mark", df.parse("OCTOBER 1 1980"));
map.put("Missy", df.parse("SEPTEMBER 1 1980"));
map.put("Nancy", df.parse("JULY 1 1980"));
map.put("Jim", df.parse("APRIL 1 1980"));
map.put("Matt", df.parse("MARCH 1 1980"));
map.put("Mariah", df.parse("MAY 1 1980"));
map.put("Bill", df.parse("JUNE 1 1980"));
return map;
//write your code here
}
public static void removeAllSummerPeople(HashMap<String, Date> map) {
for (Map.Entry<String, Date> pair : map.entrySet()) {
String value = pair.getValue().toString();
if (value.contains("JUNE") || value.contains("AUGUEST") || value.contains("JULY")) {
map.remove(pair.getKey());
}
}
}
public static void main(String[] args) {
}
}