com.io7m.jranges.core/src/main/java/com/io7m/jranges/RangeCheck.java
public static long checkIncludedInLong(
    final long x,
    final String x_name,
    final RangeInclusiveL range,
    final String range_name)
  {
    Objects.requireNonNull(x_name, "Value name");
    Objects.requireNonNull(range, "Range");
    Objects.requireNonNull(range_name, "Range name");

    if (range.includesValue(x)) {
      return x;
    }

    final var message = String.format(
      "%s <= %s (%s) <= %s (%s) == false",
      Long.valueOf(range.lower()),
      x_name,
      Long.valueOf(x),
      Long.valueOf(range.upper()),
      range_name);

    throw new RangeCheckException(message);
  }
public static long checkIncludedInLong(
    final long x,
    final String x_name,
    final RangeInclusiveL range,
    final String range_name)
  {
    Objects.requireNonNull(x_name, "Value name");
    Objects.requireNonNull(range, "Range");
    Objects.requireNonNull(range_name, "Range name");

    if (range.includesValue(x)) {
      return x;
    }

    final var message = String.format(
      "%s <= %s (%s) <= %s (%s) == false",
      Long.valueOf(range.lower()),
      x_name,
      Long.valueOf(x),
      Long.valueOf(range.upper()),
      range_name);

    throw new RangeCheckException(message);
  }
<p> Assert that {@code x} (named {@code x_name}) is included in the given
range {@code range} (named {@code range_name}). </p>

@param x          The checked value
@param x_name     The name of the checked value
@param range      The inclusive range
@param range_name The name of the inclusive range

@return x

@since 2.0.0