### Question:
DefaultHashMap extends HashMap<K, V> { @SuppressWarnings("unchecked") @Override public V get(Object key) { V value = super.get(key); if (value == null) { if (defaultValue == null) { try { value = cls.newInstance(); } catch (Exception e) { e.printStackTrace(); } } else { value = (V) defaultValue; } this.put((K) key, value); } return value; } @SuppressWarnings({ "rawtypes", "unchecked" })  DefaultHashMap(Class factory);  DefaultHashMap(Number defaultValue); @SuppressWarnings("unchecked") @Override V get(Object key); static Map<T, Integer> intDefaultMap(); static Map<T, Double> doubleDefaultMap(); static Map<T, Float> floatDefaultMap(); static Map<T, String> stringDefaultMap();  }### Answer:
@Test public void test() { Map<String, List<String>> dm = new DefaultHashMap<String, List<String>>( ArrayList.class); dm.get("nokey").add("one"); dm.get("nokey").add("two"); assertEquals(2, dm.get("nokey").size()); assertEquals(0, dm.get("nokey2").size()); }