LinkedHashMap extends AbstractMap<K, V> implements Map<K, V> { public Set<K> keySet() { return new KeySet(); } LinkedHashMap();  LinkedHashMap(int capacity);  LinkedHashMap(int capacity, float loadFactor); int size(); boolean isEmpty(); void clear(); V get(final Object key); V put(final K key, @NotNull final V value); boolean containsKey(final Object key); V remove(final Object key); Set<K> keySet(); Collection<V> values(); Set<Map.Entry<K, V>> entrySet();  }
@Test public void keySet() { final LinkedHashMap<Integer, String> tested = new LinkedHashMap<Integer, String>(); for (int i = 0; i < 10000; ++i) { tested.put(i, Integer.toString(i)); } int i = 10000; for (Integer key : tested.keySet()) { Assert.assertEquals(--i, key.intValue()); } }