@Override
	public boolean hasNext() {
		if (monitor.isCancelled()) {
			return false;
		}
		return delegate.hasNext();
	}
An {@link Iterator} wrapper that allows clients to use a task monitor to cancel iteration

@param <T> the type
Ghidra/Framework/Utility/src/main/java/ghidra/util/task/CancellableIterator.java