public void removeRange(FieldLocation start, FieldLocation end) {
		FieldRange deleteRange = new FieldRange(start, end);
		int insertIndex = Collections.binarySearch(ranges, deleteRange);

		// if exact match, remove it
		if (insertIndex >= 0) {
			ranges.remove(insertIndex);
			return;
		}

		insertIndex = -insertIndex - 2;
		if (insertIndex >= 0) {
			FieldRange range = ranges.get(insertIndex);
			if (deleteRange.intersects(range)) {
				FieldRange leftOver = range.subtract(deleteRange);
				if (range.isEmpty()) {
					ranges.remove(insertIndex);
					insertIndex--;
				}
				else if (leftOver != null) {
					ranges.add(insertIndex + 1, leftOver);
					return;
				}
			}
		}

		insertIndex++;
		while (insertIndex < ranges.size()) {
			FieldRange range = ranges.get(insertIndex);
			if (!deleteRange.intersects(range)) {
				return;
			}

			FieldRange leftOver = range.subtract(deleteRange);
			if (range.isEmpty()) {
				ranges.remove(insertIndex);
			}
			else if (leftOver != null) {
				ranges.add(insertIndex + 1, leftOver);
				return;
			}
			else {
				return;
			}
		}
	}
Removes the given field range from the current 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