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