### Question:
HashSet extends Set<E> { @Override public Iterator<E> iterator() { return backingMap.keySet().iterator(); } HashSet();  HashSet(int capacity);  HashSet(int capacity, float loadFactor);  HashSet(Collection<E> collection);  HashSet(E... args);   HashSet(HashMap<E, HashSet<E>> backingMap); @Override boolean add(E object); @Override void clear(); @Override boolean contains(E object); @Override boolean isEmpty(); @Override Iterator<E> iterator(); @Override boolean remove(E object); @Override int size();  }### Answer:
@Test public void testIterator() { Iterator<Object> i = hs.iterator(); int x = 0; while (i.hasNext()) { assertTrue("Failed to iterate over all elements", hs.contains(i.next())); ++x; } assertTrue("Returned iteration of incorrect size", hs.size() == x); }