private AddressRange trimRange(AddressRange range) {
		if (range == null) {
			return null;
		}
		// if no iterator bounds set, no trimming needed
		if (iteratorStart == null) {
			return range;
		}

		if (range.compareTo(iteratorStart) > 0 && range.compareTo(iteratorEnd) < 0) {
			return range;
		}

		Address start = Address.max(range.getMinAddress(), iteratorStart);
		Address end = Address.min(range.getMaxAddress(), iteratorEnd);
		if (start.compareTo(end) <= 0) {
			return new AddressRangeImpl(start, end);
		}
		return null;
	}
Make sure the range is within the iterator's given start and end range. This really only
matters for the first and last range returned by the iterator, but it hard to know when
the given range is the first or last, just trim all returned ranges.
@param range the range to be trimmed
@return the trimmed address range
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/util/AddressRangeMapIterator.java