void () { addElement(new Object()); addElement(new Object()); addElement(new Object()); Iterator<Object> iterator = myWeakList.iterator(); assertSame(myHolder.get(0), iterator.next()); iterator.remove(); gc(); assertEquals(2, myWeakList.toStrongList().size()); iterator.next(); gc(); assertEquals(2, myWeakList.toStrongList().size()); assertSame(myHolder.get(2), iterator.next()); assertFalse(iterator.hasNext()); myHolder.remove(1); }