### Question:
SmallMap extends AbstractMap<K, V> { @Override public V get(Object key) { rejectIfNull(key); if (entries != null) { return entries.get(key); } if (firstKey != null && firstKey.equals(key)) { return firstValue; } return null; } SmallMap(); @Override V get(Object key); @Override V put(K key, V value); @Override void putAll(Map<? extends K, ? extends V> m); @Override V remove(Object key); @Override boolean containsKey(Object key); @Override boolean containsValue(Object value); @Override void clear(); @Override int size(); @Override Set<Entry<K, V>> entrySet();  }### Answer:
@Test(dependsOnMethods = { "testPutAndSize" }) public void testGet() throws Exception { SmallMap<Integer, String> map = new SmallMap<>(); assertEquals(map.get(1), null); assertEquals(map.get(2), null); map.put(1, "one"); assertEquals(map.get(1), "one"); assertEquals(map.get(2), null); map.put(1, "ONE"); assertEquals(map.get(1), "ONE"); assertEquals(map.get(2), null); map.put(2, "two"); assertEquals(map.get(1), "ONE"); assertEquals(map.get(2), "two"); }
@Test(expectedExceptions = { NullPointerException.class }) public void testGetRejectsNull() throws Exception { new SmallMap<Integer, String>().get(null); }