@Override
    public int addFutureMeeting(Set<Contact> contacts, Calendar date) {
        int id = 0;
        Calendar now = Calendar.getInstance();
        Meeting newFutureMeeting = null;
        //check date against current date to determine if in the past
        if (date.getTime().compareTo(now.getTime()) < 0) {
            throw new IllegalArgumentException("Date specified is in the past");
        } else {
            for (Contact curr : contacts) {
                if (!allContacts.contains(curr)) {
                    throw new IllegalArgumentException("Contact " + curr.getName() + " does not exist");
                }
            }
        }
        //keep generating new id's if this random id already exists in the list
        do {
            id = generateRandomID();
        }
        while (meetingIdExists(id));

         //A meeting is considered a duplicate if it has the same contact list and same date/time
        if (!meetingExists(contacts, date)) {
            newFutureMeeting = new FutureMeetingImpl(id, date, contacts);
            allMeetings.add(newFutureMeeting);
            id=newFutureMeeting.getId();
        } else {
            //throwing a runtime exception if the meeting already exists
            throw new IllegalArgumentException("Meeting already exists!");
        }
        return id;
    }