### Question:
IntHashSet extends AbstractSet<Integer> { @Override public @NotNull Iterator<Integer> iterator() { return new HashSetIterator<Integer>() { @Override public Integer next() { return nextEntry().key; } }; } IntHashSet();  IntHashSet(int capacity);  IntHashSet(int capacity, float loadFactor); boolean contains(final int key); @Override boolean contains(final Object key); boolean add(final int key); @Override boolean add(Integer key); boolean remove(int key); @Override boolean remove(Object key); @Override @NotNull Iterator<Integer> iterator(); @Override int size();  }### Answer:
@Test public void iterator() { final Set<Integer> tested = new IntHashSet(); final Set<Integer> set = new java.util.HashSet<>(); for (int i = 0; i < 10000; ++i) { tested.add(i); set.add(i); } for (Integer key : tested) { Assert.assertTrue(set.remove(key)); } Assert.assertEquals(0, set.size()); }