public static long addContact(Contact contact, long sessionID) throws SessionException {
        if (sessionID <= NO_SESSION_ID) {
            sessionID = getSessionID();
        }
        if (contacts.indexOf(contact) != -1) {
            if (!editContacts.containsValue(contact)) {
                editContacts.put(new Long(sessionID), contact);
            } else {
                throw new SessionException("This contact is currently being edited by another user.",
                        SessionException.CONTACT_BEING_EDITED);
            }
        } else {
            contacts.add(contact);
            editContacts.put(new Long(sessionID), contact);
        }
        return sessionID;
    }