consumingIterator

Returns a view of the supplied this that removes each element from the supplied this as it is returned.

The provided iterator must support remove or else the returned iterator will fail on the first call to next.

Return

an iterator that removes and returns elements from the supplied iterator

See also