LightWeightHashSet implements Collection<T> { @Override public boolean removeAll(Collection<?> c) { boolean changed = false; for (Object aC : c) { changed |= remove(aC); } return changed; } @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);  }
@Test public void testRemoveAll() { LOG.info("Test remove all"); for (Integer i : list) { assertTrue(set.add(i)); } for (int i = 0; i < NUM; i++) { assertTrue(set.remove(list.get(i))); } for (int i = 0; i < NUM; i++) { assertFalse(set.contains(list.get(i))); } Iterator<Integer> iter = set.iterator(); assertFalse(iter.hasNext()); assertTrue(set.isEmpty()); LOG.info("Test remove all - DONE"); }