com.io7m.jranges.core/src/main/java/com/io7m/jranges/RangeCheck.java
public static RangeInclusiveL checkRangeIncludedInLong(
    final RangeInclusiveL inner,
    final String inner_name,
    final RangeInclusiveL outer,
    final String outer_name)
  {
    Objects.requireNonNull(inner, "Inner range");
    Objects.requireNonNull(inner_name, "Inner range name");
    Objects.requireNonNull(outer, "Outer range");
    Objects.requireNonNull(outer_name, "Outer range name");

    if (inner.isIncludedIn(outer)) {
      return inner;
    }

    final var message = String.format(
      "Inner range %s (%s) not included in outer range %s (%s)",
      inner_name,
      inner,
      outer_name,
      outer);

    throw new RangeCheckException(message);
  }
public static RangeInclusiveL checkRangeIncludedInLong(
    final RangeInclusiveL inner,
    final String inner_name,
    final RangeInclusiveL outer,
    final String outer_name)
  {
    Objects.requireNonNull(inner, "Inner range");
    Objects.requireNonNull(inner_name, "Inner range name");
    Objects.requireNonNull(outer, "Outer range");
    Objects.requireNonNull(outer_name, "Outer range name");

    if (inner.isIncludedIn(outer)) {
      return inner;
    }

    final var message = String.format(
      "Inner range %s (%s) not included in outer range %s (%s)",
      inner_name,
      inner,
      outer_name,
      outer);

    throw new RangeCheckException(message);
  }
public static RangeInclusiveL checkRangeIncludedInLong ( final RangeInclusiveL inner , final String inner_name , final RangeInclusiveL outer , final String outer_name ) { Objects . requireNonNull ( inner , "Inner range" ) ; Objects . requireNonNull ( inner_name , "Inner range name" ) ; Objects . requireNonNull ( outer , "Outer range" ) ; Objects . requireNonNull ( outer_name , "Outer range name" ) ; if ( inner . isIncludedIn ( outer ) ) { return inner ; } final var message = String . format ( "Inner range %s (%s) not included in outer range %s (%s)" , inner_name , inner , outer_name , outer ) ; throw new RangeCheckException ( message ) ; }
<p> Assert that {@code inner} (named {@code inner_name}) is included in the
given range {@code outer} (named {@code outer_name}). </p>

@param inner      The checked range
@param inner_name The name of the checked range
@param outer      The outer range
@param outer_name The name of the outer range

@return inner

@since 2.0.0
<p > Assert that { @code inner } ( named { @code inner_name } ) is included in the given range { @code outer } ( named { @code outer_name } ) . < / p >