### Question:
MemAddressBook implements GlobalAddressBook { @Override public Contact getContact(String contactId) { Contact result = addressBookMap.get(contactId); if(result == null) { throw new InvalidIdException(); } return result; }  @Override String addContact(Contact contact); @Override Contact getContact(String contactId); IdGenerator getIdGenerator(); void setIdGenerator(IdGenerator idGenerator); @Override List<Contact> getAll(); @Override void deleteContact(String id);  }### Answer:
@Test public void testGetContact() { defaultContact.setFirstName("Pedro"); String expectedId = addressBook.addContact(defaultContact); Contact actualContact = addressBook.getContact(expectedId); assertEquals(expectedId, actualContact.getId()); assertEquals("Pedro", actualContact.getFirstName()); }
@Test(expected = InvalidIdException.class) public void testGetContactInvalidId() { addressBook.getContact("INVALID"); }