@Override
	public boolean hasNext() throws CancelledException {

		// Next sub block is already waiting
		if (nextSub != null)
			return true;

		// Check block list for available block
		if (!blockList.isEmpty()) {
			nextSub = blockList.removeFirst();
			if (nextSub != null)
				return true;
		}

		// Iterate over instructions looking for next block
		while (nextSub == null && instIter.hasNext()) {

			Instruction inst = instIter.next();

			// don't iterate over instructions in subroutines already found!
			Address minAddr = inst.getMinAddress();

			if (addrCoveredSoFar.contains(minAddr))
				continue;

			CodeBlock block = model.getFirstCodeBlockContaining(minAddr, monitor);
			if (block != null) {
				addrCoveredSoFar.add(block);
				nextSub = block;
			}
		}
		return (nextSub != null);
	}
@see ghidra.program.model.block.CodeBlockIterator#hasNext()
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/block/PartitionCodeSubIterator.java