src/main/java/seedu/planner/model/ModelManager.java
private void populateActivityMap(List<Activity> list) {
        for (Activity act : list) {
            if (act.getContact().isPresent() && hasContact(act.getContact().get())) {
                Contact contact = getContact(act.getContact().get()).get();
                contactActivityMap.put(contact, act);
            } else if (act.getContact().isPresent() && !hasContact(act.getContact().get())) {
                Contact contact = act.getContact().get();
                addContact(contact);
                contactActivityMap.put(contact, act);
            }
        }
    }
/**
     * Iterates through the {@code List} of {@code Activity} and creates a mapping between it's {@code Contact},
     * if it possesses one, to itself.
     */
Iterates through the  List of  Activity and creates a mapping between it's  Contact,
if it possesses one, to itself.
Iterates through the List of Activity and creates a mapping between it ' s Contact if it possesses one to itself .
private void populateActivityMap(List<Activity> list) {
        for (Activity act : list) {
            if (act.getContact().isPresent() && hasContact(act.getContact().get())) {
                Contact contact = getContact(act.getContact().get()).get();
                contactActivityMap.put(contact, act);
            } else if (act.getContact().isPresent() && !hasContact(act.getContact().get())) {
                Contact contact = act.getContact().get();
                addContact(contact);
                contactActivityMap.put(contact, act);
            }
        }
    }
private void populateActivityMap ( List < Activity > list ) { for ( Activity act : list ) { if ( act . getContact ( ) . isPresent ( ) && hasContact ( act . getContact ( ) . get ( ) ) ) { Contact contact = getContact ( act . getContact ( ) . get ( ) ) . get ( ) ; contactActivityMap . put ( contact , act ) ; } else if ( act . getContact ( ) . isPresent ( ) && ! hasContact ( act . getContact ( ) . get ( ) ) ) { Contact contact = act . getContact ( ) . get ( ) ; addContact ( contact ) ; contactActivityMap . put ( contact , act ) ; } } }
Iterates through the {@code List} of {@code Activity} and creates a mapping between it's {@code Contact},
 if it possesses one, to itself.
Iterates through the { @code List } of { @code Activity } and creates a mapping between it ' s { @code Contact } if it possesses one to itself .