@Override
    public void addMeetingNotes(int id, String text)  {
        Calendar now = Calendar.getInstance();
        Meeting convertedToPastMeeting = null;
        Meeting updatedPastMeeting = null;
        if (text == null) {
            throw new NullPointerException("Please specify notes for the meeting");
        } else if (!meetingIdExists(id)) {
            throw new IllegalArgumentException("Meeting does not exist");
        }
        for (Meeting curr : allMeetings) {
            if (curr.getId() == id) {
                if (curr.getDate().getTime().compareTo(now.getTime()) > 0) {
                    throw new IllegalStateException("This meeting is set for a date in the future");
                } else if (curr instanceof PastMeeting) {
                    //replace existing past meeting with a new identical past meeting with an addition to the notes
                    updatedPastMeeting = new PastMeetingImpl(curr.getId(), curr.getDate(), curr.getContacts(), ((PastMeeting) curr).getNotes()+" "+text);
                    allMeetings.add(updatedPastMeeting);
                    allMeetings.remove(curr);
                } else if (curr instanceof FutureMeeting) {
                    //replace existing future meeting with an identical past meeting, remove future meeting from records
                    convertedToPastMeeting = new PastMeetingImpl(curr.getId(), curr.getDate(), curr.getContacts(), text);
                    allMeetings.remove(curr);
                    allMeetings.add(convertedToPastMeeting);
                }
            }
        }
    }