private ObjectValueRange<T> adjustPreviousRangeForOverlap(long start, long end, T object, 
			ObjectValueRange<T> newRange, int pos) {
		
		ObjectValueRange<T> previousRange = ranges.get(pos);
		if ( previousRange.getEnd() < start-1 ) {
			return newRange;  // no overlap
		}
		
		long oldStart = previousRange.getStart();
		long oldEnd = previousRange.getEnd();
		T oldValue = previousRange.getValue();
		
		if (valuesEqual(previousRange.getValue(), object)) {  // same objects, merge
			ranges.remove(pos);
			newRange = new ObjectValueRange<T>(oldStart, Math.max(oldEnd, end), object);
		}		
		// break previous record into sub-ranges that exclude the new range
		else {  
			ranges.set(pos, new ObjectValueRange<T>(oldStart, start-1, oldValue));
			
			// previous range extends past the new range
			if (previousRange.getEnd() > end) {
				ranges.add(pos+1, new ObjectValueRange<T>(end+1, oldEnd, oldValue));
			}
		}
		
		return newRange;
	}
Associates the given object with all indices in the given range. The object may be null,
but an assocition 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/Generic/src/main/java/ghidra/util/datastruct/ObjectRangeMap.java