private Address fixupIntersectingRecords(Address startAddr, Address endAddr, Field value)
			throws IOException {
		RecordIterator it = new AddressKeyRecordIterator(rangeMapTable, addressMap, startAddr,
			endAddr, startAddr, true);

		while (it.hasNext()) {
			DBRecord record = it.next();
			it.delete(); // all the records that start in the paint region need to be deleted
			Address recordEndAddress = getEndAddress(record);
			if (recordEndAddress.compareTo(endAddr) > 0) {
				Field recordValue = getValue(record);
				if (recordValue.equals(value)) {
					// since the last record has same value, it extends our paintRange
					return recordEndAddress;
				}
				// the last record extended past the paint range with a different value,
				// create a remainder record
				createRecord(endAddr.add(1), recordEndAddress, recordValue);
			}
		}
		return endAddr;

	}
Removes any records that are being painted over and maybe merges with or truncates the
last record that starts in our paint range
@param startAddr the start of the paint range
@param endAddr the end of the paint range
@param value the value we are painting
@return the new end address for our paint. if we find a record with our value that
extends past our end, we delete it and extend our end range.
@throws IOException if a database I/O error occurs
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/database/util/AddressRangeMapDB.java