Iterator<T> () { if (theElement == null) { return super.iterator(); } return new SingletonIteratorBase<T>() { @Override protected void checkCoModification() { if (theElement == null) { throw new ConcurrentModificationException(); } } @Override protected T getElement() { return theElement; } @Override public void remove() { checkCoModification(); clear(); } }; }