import java.util.Scanner; import java.util.ArrayList; import java.util.*; /** * Created by leon on 1/23/18. */ public class PhoneBook { private String name; private String phoneNumber; TreeMapphonebook = new TreeMap<>(); public PhoneBook() { } public PhoneBook(String name, String phoneNumber) { this.name = name; this.phoneNumber = phoneNumber; } public PhoneBook (TreeMapphonebook) { this.phonebook = phonebook; } public void add(String name, String phoneNumber) { phonebook.put(name, phoneNumber); } public void remove(String name) { phonebook.remove(name); } public void removeRecord() { phonebook.clear(); } public Collection lookup (String name) { return phonebook.values(); } public Collection reverseLookup(String phoneNumber) { return phonebook.keySet(); } public TreeMap display() { return phonebook; } public void entries () { } }