public Iterator<E> snapshotIterator(){
  List<E> l=new ArrayList<E>();
  l.addAll(this);
  return l.iterator();
}

public Iterator < E > snapshotIterator ( ) { List < E > l = new ArrayList < E > ( ) ; l . addAll ( this ) ; return l . iterator ( ) ; }
returns an iterator over a copy of this chain . this avoids concurrentmodificationexceptions from being thrown if the underlying chain is modified during iteration . do not use this to remove elements which have not yet been iterated over !
