### Question:
Collection extends jsimple.lang.Iterable<E> { public boolean retainAll(Collection<E> collection) { boolean result = false; Iterator<E> it = iterator(); while (it.hasNext()) { if (!collection.contains(it.next())) { it.remove(); result = true; } } return result; } protected  Collection(); boolean add(E object); boolean addAll(Collection<? extends E> collection); void clear(); boolean contains(E object); boolean containsAll(Collection<E> collection); boolean isEmpty(); @Override abstract Iterator<E> iterator(); boolean remove(E object); boolean removeAll(Collection<E> collection); boolean retainAll(Collection<E> collection); abstract int size(); Object[] toArray(); void toArray(E[] contents); @Override String toString();  }### Answer:
@Test public void testRetainAll() { final String[] removed = new String[1]; Collection<String> ac = new TestRetainAllCollection(this, removed); assertTrue(ac.retainAll(new ArrayList<String>("1", "2"))); assertEquals("0", removed[0]); }