### Question:
RangeSet implements IRangeSet<E> { @Override public boolean retainAll(Collection<?> c) { boolean modified = false; Iterator<E> e = iterator(); while (e.hasNext()) { if (!c.contains(e.next())) { e.remove(); modified = true; } } return modified; } RangeSet();  RangeSet(IEnumerator<E> enumerator); @Override int getNumberOfRanges(); @Override Iterator<Range<E>> rangeIterator(); @Override List<Range<E>> toRangeList(); @Override int approximateSize(); @Override boolean addRange(E first, E last); @Override boolean removeRange(E first, E last); @Override int size(); @Override boolean isEmpty(); @Override boolean contains(Object o); @Override Iterator<E> iterator(); @Override Object[] toArray(); @SuppressWarnings("unchecked") @Override T[] toArray(T[] a); @Override boolean add(E e); @Override boolean remove(Object o); @Override boolean containsAll(Collection<?> c); @Override boolean addAll(Collection<? extends E> c); @Override boolean retainAll(Collection<?> c); @Override boolean removeAll(Collection<?> c); @Override void clear(); boolean equals(Object o); int hashCode(); String toString();  }### Answer:
@Test public void testRetainAll() { for (int i = 0; i < 10; i++) { IRangeSet<Integer> range = randomRangeSet(-100, 100, 10); randomCheckedRangeSet(-100, 100, 10).retainAll(range); } }