@Test public void iterator() { final LinkedHashSet<Integer> tested = new LinkedHashSet<>(); for (int i = 0; i < 10000; ++i) { tested.add(i); } int i = 0; for (Integer key : tested) { Assert.assertEquals(i++, key.intValue()); tested.remove(key); } Assert.assertEquals(0, tested.size()); }
@Override public @NotNull Iterator<E> iterator() { return new LinkedHashIterator(); }
LinkedHashSet extends AbstractSet<E> { @Override public @NotNull Iterator<E> iterator() { return new LinkedHashIterator(); } }
LinkedHashSet extends AbstractSet<E> { @Override public @NotNull Iterator<E> iterator() { return new LinkedHashIterator(); } LinkedHashSet();  LinkedHashSet(int capacity);  LinkedHashSet(int capacity, float loadFactor); }
LinkedHashSet extends AbstractSet<E> { @Override public @NotNull Iterator<E> iterator() { return new LinkedHashIterator(); } LinkedHashSet();  LinkedHashSet(int capacity);  LinkedHashSet(int capacity, float loadFactor); @Override int size(); @Override boolean contains(final Object key); @Override boolean add(E key); @Override boolean remove(Object key); @Override @NotNull Iterator<E> iterator(); @Nullable E getTop(); @Nullable E getBack(); }
LinkedHashSet extends AbstractSet<E> { @Override public @NotNull Iterator<E> iterator() { return new LinkedHashIterator(); } LinkedHashSet();  LinkedHashSet(int capacity);  LinkedHashSet(int capacity, float loadFactor); @Override int size(); @Override boolean contains(final Object key); @Override boolean add(E key); @Override boolean remove(Object key); @Override @NotNull Iterator<E> iterator(); @Nullable E getTop(); @Nullable E getBack();  }