private AddressValueRange<T> adjustRemainingRangeForOverlap(T object,
			AddressValueRange<T> newRange, int insertionIndex, Address newEnd) {

		if (insertionIndex >= ranges.size()) {
			return newRange; // no record to adjust
		}

		AddressValueRange<T> range = ranges.get(insertionIndex);
		if (range.getStart().compareTo(newEnd.next()) > 0) { // no overlap
			return newRange;
		}

		if (valuesEqual(range.getValue(), object)) { // merge records
			ranges.remove(insertionIndex);
			newRange = new AddressValueRange<T>(newRange.getStart(), range.getEnd(), object);
		}
		// overwrite the old record to start past the end of the new range
		else {
			ranges.set(insertionIndex, new AddressValueRange<T>(newEnd.next(), range.getEnd(),
				range.getValue()));
		}

		return newRange;
	}
Associates the given object with all indices in the given range. The object may be null,
but an association is still established.  Use the clearRange() method to remove associations.
@param start the start of the range.
@param end the end (inclusive) of the range.
@param object the object to associate with the given range.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/register/AddressRangeObjectMap.java