ListMap implements List<V>, Cloneable, Serializable { public Set<? extends K> keySet() { return keyMap.keySet(); } ListMap();  ListMap(Collection<? extends V> collection);  ListMap(int size);  ListMap(ListMap<K, V> other); @Override ListMap<K, V> clone(); void makeUnmodifiable(); @Override void add(int index, V element); boolean add(K key, V value); boolean add(K[] keys, V value); @Override boolean add(V value); @Override boolean addAll(Collection<? extends V> values); @Override boolean addAll(int index, Collection<? extends V> values); boolean addAll(int index, V[] items); void addAll(K[] keys, V[] items); void addAll(List<K> keys, List<V> items); boolean addAll(ListMap<K, V> old); void addAll(ListMap<K, V> old, K[] order); void addAll(Set<Entry<K, V>> list); boolean addAll(V[] items); boolean addAndLabel(V value, K... keys); @Override void clear(); void clearKeys(); @Override boolean contains(Object value); @Override boolean containsAll(Collection<?> values); boolean containsKey(K key); boolean containsValue(V value); Set<Entry<K, V>> entrySet(); @SuppressWarnings("unchecked") @Override boolean equals(Object other); @Override V get(int index); V get(K key); K getKey(V value); @Override int hashCode(); @Override int indexOf(Object value); int indexOfKey(K key); @Override boolean isEmpty(); @Override Iterator<V> iterator(); Set<? extends K> keySet(); @Override int lastIndexOf(Object value); @Override ListIterator<V> listIterator(); @Override ListIterator<V> listIterator(int index); V put(K key, V value); void putAll(ListMap<K, ? extends V> old, K[] newOrder); @SuppressWarnings("unchecked") void putAll(ListMap<K, V> m, int[] order); void putAll(Map<? extends K, ? extends V> m); void putAll(Map<K, ? extends V> m, K[] order); int putKey(K key, int index); int putKey(K newKey, K existingKey); boolean putKey(K[] keys, int index); @Override V remove(int index); @Override boolean remove(Object value); @Override boolean removeAll(Collection<?> values); int removeKey(K key); @Override boolean retainAll(Collection<?> values); void rotate(int startIdx, int changeCount, int dir); @Override V set(int index, V value); @Override int size(); @Override List<V> subList(int start, int end); @Override Object[] toArray(); @SuppressWarnings("unchecked") @Override T[] toArray(T[] a); Collection<V> values();  }
@Test public void keySet() { ListMap<String, Boolean> lm = new ListMap<String, Boolean>(); lm.addAndLabel(true, "true", "yes"); assertTrue(lm.get(0)); assertTrue(lm.get("true")); assertTrue(lm.get("yes")); lm.addAndLabel(false, "false", "no"); assertFalse(lm.get(1)); assertFalse(lm.get("false")); assertFalse(lm.get("no")); assertEquals(2, lm.size()); Set<? extends String> s = lm.keySet(); assertEquals(4, s.size()); for (String z : s) { assertNotNull(z); } }