SlotListImpl implements SlotList<T> { @Override public Iterator<Slot> iterator() { return new LinkedList<>(list).iterator(); }  @Override int size(); @Override boolean add(Slot slot); @Override void remove(Slot slot); @Override Slot find(T listener); @Override Iterator<Slot> iterator(); @Override void clear();  }
@Test public void iterator() throws Exception { int count = 0; for (Slot slot : slotList) { slotList.remove(slot); ++count; } assertThat(count, is(10)); }