private void updateLastAddress(Address startAddress) {
		if (startAddress == null) {
			return;
		}

		if (forward) {
			if (startAddress.getOffset() > 0) {
				lastAddress = startAddress.subtract(1);
			}
		}
		else {
			// don't add past the address range
			AddressSpace addressSpace = startAddress.getAddressSpace();
			Address maxAddress = addressSpace.getMaxAddress();
			long maxOffset = maxAddress.getOffset();
			long startOffset = startAddress.getOffset();
			long result = startOffset + 1;
			if (result > startOffset && result < maxOffset) {
				lastAddress = startAddress.add(1);
			}
		}
	}
An iterator for returning addresses that can take in 1 or more search iterators to iterator over
addresses provided by each of those search iterators.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/ListingDisplaySearchAddressIterator.java