static FieldSpan sub(Field from, boolean fromInclusive, Field to, boolean toInclusive,
			Direction direction) {
		if (from.equals(to) && (!fromInclusive || !toInclusive)) {
			return EMPTY;
		}
		return direction == Direction.FORWARD
				? DOMAIN.closed(End.lower(from, fromInclusive), End.upper(to, toInclusive))
				: DOMAIN.closed(End.lower(to, toInclusive), End.upper(from, fromInclusive));
	}
Get the span for a sub collection

<p>
{@code from} must precede {@code to}, unless direction is {@link Direction#BACKWARD}, in
which case the opposite is required. The endpoints may be equal but unless both are
inclusive, the result is {@link #EMPTY}. The two endpoints are not automatically inverted to
correct ordering. More often than not, accidental mis-ordering indicates an implementation
flaw.

@param from the lower bound
@param fromInclusive true if the bound includes {@code from}
@param to the upper bound
@param toInclusive true if the bound includes {@code to}
@param direction the direction, true to swap {@code from} and {@code to}
@return the span
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/FieldSpan.java