BidirectionalMultiMap { public boolean containsKey(K key) { return _primaryMap.containsKey(key); } BidirectionalMultiMap(); private  BidirectionalMultiMap(SetMultimap<K, V> primaryMap, SetMultimap<V, K> secondaryMap); private  BidirectionalMultiMap(SetMultimap<K, V> primaryMap, SetMultimap<V, K> secondaryMap,
                                BidirectionalMultiMap<V, K> inverse); BidirectionalMultiMap<V, K> inverse(); void put(K key, V value); Set<V> get(K key); boolean containsKey(K key); Set<K> keySet(); void remove(K key, V value); int size(); Set<V> removeAll(K key);  }
@Test public void testContainsKey() { _bidirectionalMultiMap.put("A", 1); _bidirectionalMultiMap.put("A", 2); _bidirectionalMultiMap.put("A", 3); _bidirectionalMultiMap.put("B", 2); _bidirectionalMultiMap.put("B", 3); _bidirectionalMultiMap.put("C", 3); assertThat(_bidirectionalMultiMap.containsKey("A"), is(true)); assertThat(_bidirectionalMultiMap.containsKey("Z"), is(false)); assertThat(_bidirectionalMultiMap.containsKey(null), is(false)); assertThat(_bidirectionalMultiMap.inverse().containsKey(1), is(true)); assertThat(_bidirectionalMultiMap.inverse().containsKey(3), is(true)); assertThat(_bidirectionalMultiMap.inverse().containsKey(99), is(false)); }