### Question:
GlobalAddressBook { public Contact getContact(String contactId) { Contact result = addressBookMap.get(contactId); if(result == null) { throw new InvalidIdException(); } return result; }  String addContact(Contact contact); List<Contact> getAll(); Contact getContact(String contactId); void deleteContact(String id); IdGenerator getIdGenerator(); void setIdGenerator(IdGenerator idGenerator);  }### Answer:
@Test public void testGetContact() { expectedContact.setFirstName("Pedro"); String expectedId = addressBook.addContact(expectedContact); Contact actual = addressBook.getContact(expectedId); assertEquals(expectedId, actual.getId()); assertEquals("Pedro", actual.getFirstName()); }
@Test public void testGetContactInvalidId() { try { addressBook.getContact("INVALID"); fail("testGetContactInvalidId: Expected Exception"); } catch (InvalidIdException ex) { assertTrue(true); } }