### Question:
MemAddressBook implements GlobalAddressBook { @Override public String addContact(Contact contact) { String id = idGenerator.newId(); if(addressBookMap.get(id) != null) { throw new InvalidIdException(); } contact.setId(id); addressBookMap.put(id, contact); return id; } MemAddressBook();  MemAddressBook(IdGenerator idGenerator); void setIdGenerator(IdGenerator idGenerator); IdGenerator getIdGenerator(); @Override String addContact(Contact contact); @Override Contact getContact(String contactId); @Override List<Contact> getAll();  }### Answer:
@Test public void testAddContact() { Contact contact = new Contact(); String contactId = addressBook.addContact(contact); assertNotNull(contactId); assertTrue(contactId.trim().length() > 0); }