com.io7m.jranges.core/src/main/java/com/io7m/jranges/RangeCheck.java
public static BigInteger checkLessEqualBig(
    final BigInteger x,
    final String x_name,
    final BigInteger in_upper,
    final String upper_name)
  {
    Objects.requireNonNull(x, "Value");
    Objects.requireNonNull(x_name, "Value name");
    Objects.requireNonNull(in_upper, "Upper");
    Objects.requireNonNull(upper_name, "Upper bound name");

    if (x.compareTo(in_upper) <= 0) {
      return x;
    }

    final var message =
      String.format("%s (%s) > %s (%s)", x_name, x, upper_name, in_upper);

    throw new RangeCheckException(message);
  }
public static BigInteger checkLessEqualBig(
    final BigInteger x,
    final String x_name,
    final BigInteger in_upper,
    final String upper_name)
  {
    Objects.requireNonNull(x, "Value");
    Objects.requireNonNull(x_name, "Value name");
    Objects.requireNonNull(in_upper, "Upper");
    Objects.requireNonNull(upper_name, "Upper bound name");

    if (x.compareTo(in_upper) <= 0) {
      return x;
    }

    final var message =
      String.format("%s (%s) > %s (%s)", x_name, x, upper_name, in_upper);

    throw new RangeCheckException(message);
  }
<p> Assert that {@code x} (named {@code x_name}) is less than or equal to
{@code in_upper} (named {@code upper_name}). </p>

@param x          The checked value
@param in_upper   The upper bound
@param x_name     The name of the checked value
@param upper_name The name of the upper bound

@return x