I don't understand why I can't validate the last point of this mission. My delete function seems fine to me, though...
package fr.codegym.task.task08.task0816;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
/*
La gentille Emma et les vacances d'été
*/
public class Solution {
public static HashMap<String, Date> creerMap() 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"));
//écris ton code ici
map.put("Rémi", df.parse("JUNE 1 1980"));
map.put("Bastien", df.parse("JULY 23 1980"));
map.put("Alison", df.parse("OCTOBER 3 1980"));
map.put("Léa", df.parse("DECEMBER 5 1980"));
map.put("Caro", df.parse("JUNE 1 1980"));
map.put("Gzon", df.parse("AUGUST 2 1980"));
map.put("Raph", df.parse("JANUARY 9 1980"));
map.put("Mathildus", df.parse("FEBRUARY 3 1980"));
map.put("Killian", df.parse("JUNE 14 1980"));
return map;
}
public static void supprimerToutesPersonnesEte(HashMap<String, Date> map) {
//écris ton code ici
Iterator<Map.Entry<String, Date>> iterateur = map.entrySet().iterator();
while(iterateur.hasNext())
{
Map.Entry<String, Date> paire = iterateur.next();
int month = paire.getValue().getMonth();
String key = paire.getKey();
if (month >= 5 && month <= 7){
map.remove(key);
}
}
}
public static void main(String[] args) {
}
}