Exemple #1
0
 private static void lookupEntry(InOut in, AddressBook book) {
   String name = in.nextLine("Enter name: ");
   String key = in.nextLine("Enter key: ");
   String value = book.get(name, key);
   if (value == null) in.message("No entry");
   else in.message("Value: " + value);
 }
 @Test
 public void deptDirContainsHorstmann() {
   assertNotNull(deptDir.get("Horstmann", "Phone"));
 }
 @Test(expected = NoSuchElementException.class)
 public void RemoveTester() {
   dir.put("Horstmann", "Phone", "2");
   dir.remove("Horstmann", "Phone");
   assertNull(dir.get("Horstmann", "Phone"));
 }