An iterator that should be closed as soon as it is not used anymore.
The close() method is used to close the iterator at any time. It is
not an error to close() an iterator that already has been closed.
This iterator also auto-closes when hasNext() is called and no more
elements are available.
Close the iteratori and free all resources. This method can be called
more than once, all calls after the first one have no effect.
After close() has been called, hasNext() is guaranteed to return false.
After close() it is an error the call next(). close will throw
a GateRuntimeException in that case.
This method is called automatically when hasNext() is called and no
more elements are available.