Class IteratorCollection

java.lang.Object
java.util.AbstractCollection
org.codehaus.janino.util.iterator.IteratorCollection
All Implemented Interfaces:
Iterable, Collection

public class IteratorCollection extends AbstractCollection
A Collection that lazily reads its elements from an Iterator.

In other words, you can call iterator() as often as you want, but the IteratorCollection will iterate over its delegate only once.