@Override
	public Spliterator<AddressRange> spliterator() {
		long countAddrs = end.subtract(nextStartAddress) + 1;
		long size = Long.divideUnsigned(countAddrs + chunkSize - 1, chunkSize);
		return Spliterators.spliterator(iterator(), size,
			Spliterator.DISTINCT | Spliterator.NONNULL | Spliterator.ORDERED | Spliterator.SORTED |
				Spliterator.SIZED);
	}
A class to break a range of addresses into 'chunks' of a give size. This is useful to break-up
processing of large swaths of addresses, such as when performing work in a background thread.
Doing this allows the client to iterator over the range, pausing enough to allow the UI to
update.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/address/AddressRangeChunker.java