private static void addChangeEntry(InOut in, AddressBook book) { String name = in.nextLine("Enter name: "); String key = in.nextLine("Enter key: "); String value = in.nextLine("Enter value: "); String oldValue = book.put(name, key, value); if (oldValue == null) in.message("Entry added"); else in.message("Entry updated"); }
@Test(expected = NoSuchElementException.class) public void RemoveTester3() { dir.put("Bob", "Phone", "2"); assertNull(dir.remove("Me", "Phone")); }
@Test(expected = NoSuchElementException.class) public void RemoveTester() { dir.put("Horstmann", "Phone", "2"); dir.remove("Horstmann", "Phone"); assertNull(dir.get("Horstmann", "Phone")); }