### Question:
LightWeightHashSet implements Collection<T> { @Override @SuppressWarnings("unchecked") public void clear() { this.capacity = this.initialCapacity; this.hash_mask = capacity - 1; this.expandThreshold = (int) (capacity * maxLoadFactor); this.shrinkThreshold = (int) (capacity * minLoadFactor); entries = new LinkedElement[capacity]; size = 0; modification++; } @SuppressWarnings("unchecked")  LightWeightHashSet(int initCapacity, float maxLoadFactor,
      float minLoadFactor);  LightWeightHashSet();  LightWeightHashSet(int minCapacity); @Override boolean isEmpty(); int getCapacity(); @Override int size(); @SuppressWarnings("unchecked") @Override boolean contains(final Object key); T getElement(final T key); @Override boolean addAll(Collection<? extends T> toAdd); @Override boolean add(final T element); @Override @SuppressWarnings("unchecked") boolean remove(final Object key); List<T> pollN(int n); List<T> pollAll(); @SuppressWarnings("unchecked") T[] pollToArray(T[] array); @Override Iterator<T> iterator(); @Override String toString(); void printDetails(final PrintStream out); @Override @SuppressWarnings("unchecked") void clear(); @Override Object[] toArray(); @Override @SuppressWarnings("unchecked") U[] toArray(U[] a); @Override boolean containsAll(Collection<?> c); @Override boolean removeAll(Collection<?> c); @Override boolean retainAll(Collection<?> c);  }### Answer:
@Test public void testClear() { LOG.info("Test clear"); set.addAll(list); assertEquals(NUM, set.size()); assertFalse(set.isEmpty()); set.clear(); assertEquals(0, set.size()); assertTrue(set.isEmpty()); Iterator<Integer> iter = set.iterator(); assertFalse(iter.hasNext()); LOG.info("Test clear - DONE"); }