private void addRange(Object obj, long start, long end) {
        try {
            long next;
            if (objMarkers.hasProperty(start)) {
                next = start;
            }
            else {
                next = objMarkers.getNextPropertyIndex(start);
            }

            while (start <= end) {
                // find the thing at or after
                Mark mark = getMark(next);

                if (mark.type == Mark.END) {
                    markEnd(start-1, mark.obj);
                    markStart(start, mark.obj);
                    next = start;
                }
                else if (start == next) {
                    if (mark.type == Mark.SINGLE) {
                        mark.add(obj);
                        start = start+1;
                    }
                    else { // type == Mark.START
                        next = objMarkers.getNextPropertyIndex(next);
                        start = doSplit(obj,start,next,end) + 1;
                    }
                    next = objMarkers.getNextPropertyIndex(next);
                }
                else if (start < next && next <= end) {
                    // add in start to next -1
                    markRange(start, next-1, obj);
                    start = next;
                }
                else if (next > end) {
                        break;
                }
            }
        }
        catch(NoSuchIndexException e) {
        }
        if (start <= end) {
            markRange(start, end, obj);
        }

    }
Adds a range to a object.
Assumes that the range has already been cleared.

@param range the range being added.
@param objID the id of the object the range is being
added to.
Ghidra/Framework/SoftwareModeling/src/main/java/ghidra/program/model/address/AddressObjectMap.java