public void addRange(FieldLocation start, FieldLocation end) {
		if (start.equals(end)) {
			return;
		}

		FieldRange newRange = new FieldRange(start, end);
		int insertIndex = Collections.binarySearch(ranges, newRange);
		if (insertIndex >= 0) {
			return; // already contains range
		}

		insertIndex = -insertIndex - 2;

		if (insertIndex >= 0 && ranges.get(insertIndex).canMerge(newRange)) {
			ranges.get(insertIndex).merge(newRange);
		}
		else {
			insertIndex++;
			ranges.add(insertIndex, newRange);
		}

		FieldRange currentRange = ranges.get(insertIndex);
		int checkIndex = insertIndex + 1;
		while (checkIndex < ranges.size()) {
			if (!currentRange.canMerge(ranges.get(checkIndex))) {
				break;
			}
			currentRange.merge(ranges.get(checkIndex));
			ranges.remove(checkIndex);
		}
	}
Adds a field range to this selection.
@param start the starting field location.
@param end the ending field location.
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/support/FieldSelection.java