1  public interface MyMap<K, V> {
  2    /** Remove all of the entries from this map */ 
  3    public void clear();
  4    
  5    /** Return true if the specified key is in the map */
  6    public boolean containsKey(K key);
  7    
  8    /** Return true if this map contains the specified value */ 
  9    public boolean containsValue(V value);
 10  
 11    /** Return a set of entries in the map */
 12    public java.util.Set<Entry<K, V>> entrySet();
 13  
 14    /** Return the first value that matches the specified key */
 15    public V get(K key);
 16    
 17    /** Return true if this map contains no entries */
 18    public boolean isEmpty();
 19  
 20    /** Return a set consisting of the keys in this map */
 21    public java.util.Set<K> keySet();
 22    
 23    /** Add an entry (key, value) into the map */
 24    public V put(K key, V value);
 25  
 26    /** Remove the entries for the specified key */
 27    public void remove(K key);
 28  
 29    /** Return the number of mappings in this map */
 30    public int size();
 31  
 32    /** Return a set consisting of the values in this map */
 33    public java.util.Set<V> values();
 34    
 35    /** Define inner class for Entry */
 36    public static class Entry<K, V> {
 37      K key;
 38      V value;
 39      
 40      public Entry(K key, V value) {
 41        this.key = key;
 42        this.value = value;
 43      }
 44      
 45      public K getKey() {
 46        return key;
 47      }
 48      
 49      public V getValue() {
 50        return value;
 51      }
 52      
 53      @Override
 54      public String toString() {
 55        return "[" + key + ", " + value + "]";
 56      }
 57    }
 58  }