static KeySpan head(long to, boolean toInclusive, Direction direction) {
		if (to == DOMAIN.min() && !toInclusive) {
			return EMPTY;
		}
		return direction == Direction.FORWARD
				? DOMAIN.closed(DOMAIN.min(), toInclusive ? to : to - 1)
				: DOMAIN.closed(toInclusive ? to : to + 1, DOMAIN.max());
	}
Get the span for the head of a collection

<p>
When {@code direction} is {@link Direction#BACKWARD} this behaves as if a tail collection;
however, the implication is that iteration will start from the maximum and proceed toward the
given bound.

@param to the upper bound
@param toInclusive true if the bound includes {@code to}
@param direction the direction, true to create a tail instead
@return the span
Ghidra/Debug/ProposedUtils/src/main/java/ghidra/util/database/KeySpan.java