@Test public void defaultToFive() { map = new DefaultHashMap<>(5); loadMap(); assertEquals("missing 1", 1, (int) map.get(ONE)); assertEquals("missing 2", 2, (int) map.get(TWO)); assertEquals("three?", 5, (int) map.get(THREE)); assertEquals("four?", 5, (int) map.get(FOUR)); }
@Override public V get(Object k) { return containsKey(k) ? super.get(k) : defaultValue; }
DefaultHashMap extends HashMap<K, V> { @Override public V get(Object k) { return containsKey(k) ? super.get(k) : defaultValue; } }
DefaultHashMap extends HashMap<K, V> { @Override public V get(Object k) { return containsKey(k) ? super.get(k) : defaultValue; } DefaultHashMap(V defaultValue); }
DefaultHashMap extends HashMap<K, V> { @Override public V get(Object k) { return containsKey(k) ? super.get(k) : defaultValue; } DefaultHashMap(V defaultValue); @Override V get(Object k); }
DefaultHashMap extends HashMap<K, V> { @Override public V get(Object k) { return containsKey(k) ? super.get(k) : defaultValue; } DefaultHashMap(V defaultValue); @Override V get(Object k);  }