### Question:
HashSet extends Set<E> { @Override public void clear() { backingMap.clear(); } 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 testClear() { Set<Object> orgSet = new HashSet<Object>(hs); hs.clear(); Iterator<Object> i = orgSet.iterator(); assertEquals("Returned non-zero size after clear", 0, hs.size()); while (i.hasNext()) { assertTrue("Failed to clear set", !hs.contains(i.next())); } }