@Test public void testGet() { final String key1 = "Percussion"; final String key2 = "Timpani"; final Integer expectedNo = 2; assertEquals(expectedNo, orchestraMap.get(key1, key2)); assertEquals(expectedNo, orchestraMap2.get(key1, key2)); assertNull(orchestraMap.get("invalid", key2)); assertNull(orchestraMap2.get("invalid", key2)); assertNull(orchestraMap.get(key1, "invalid")); assertNull(orchestraMap2.get(key1, "invalid")); }
public V get(final K1 firstKey, final K2 secondKey) { final HashMap<K2, V> innerMap = map.get(firstKey); if( innerMap == null ) { return null; } return innerMap.get(secondKey); }
TwoDHashMap { public V get(final K1 firstKey, final K2 secondKey) { final HashMap<K2, V> innerMap = map.get(firstKey); if( innerMap == null ) { return null; } return innerMap.get(secondKey); } }
TwoDHashMap { public V get(final K1 firstKey, final K2 secondKey) { final HashMap<K2, V> innerMap = map.get(firstKey); if( innerMap == null ) { return null; } return innerMap.get(secondKey); } TwoDHashMap();  TwoDHashMap(final HashMap<K1, HashMap<K2, V>> map); }
TwoDHashMap { public V get(final K1 firstKey, final K2 secondKey) { final HashMap<K2, V> innerMap = map.get(firstKey); if( innerMap == null ) { return null; } return innerMap.get(secondKey); } TwoDHashMap();  TwoDHashMap(final HashMap<K1, HashMap<K2, V>> map); boolean containsKey(final K1 firstKey, final K2 secondKey); V get(final K1 firstKey, final K2 secondKey); Object set(final K1 firstKey, final K2 secondKey, final V value); int size(); int size(final K1 firstKey); Set<K1> keySet(); }
TwoDHashMap { public V get(final K1 firstKey, final K2 secondKey) { final HashMap<K2, V> innerMap = map.get(firstKey); if( innerMap == null ) { return null; } return innerMap.get(secondKey); } TwoDHashMap();  TwoDHashMap(final HashMap<K1, HashMap<K2, V>> map); boolean containsKey(final K1 firstKey, final K2 secondKey); V get(final K1 firstKey, final K2 secondKey); Object set(final K1 firstKey, final K2 secondKey, final V value); int size(); int size(final K1 firstKey); Set<K1> keySet();  }