public FieldRange getRangeContaining(FieldLocation loc) {
		int insertIndex = Collections.binarySearch(ranges, new FieldRange(loc, FieldLocation.MAX));

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

		// examine range before insert index to see if we are inside it
		int compareIndex = -insertIndex - 2;

		if (compareIndex < 0) {
			return null;
		}

		FieldRange compareRange = ranges.get(compareIndex);

		if (compareRange.contains(loc)) {
			return compareRange;
		}
		return null;
	}
Returns the range if the given Field at the given index is in the selection.
Otherwise returns null.
@param loc location to find the range for.
@return the range
Ghidra/Framework/Docking/src/main/java/docking/widgets/fieldpanel/support/FieldSelection.java