public static <E extends RuntimeException> double
    requireEquals(double val, double otherVal,
                  Function<String, E> exceptionConstructor) {
        if (val != otherVal) {
            throw exceptionConstructor.apply(val + IS_NOT_EQUAL_TO + otherVal);
        }
        return val;
    }
Returns the given value if it is positive.

@param <E>  RuntimeException type

@param val                   to check
@param exceptionConstructor  to use when throwing exception
@return                      the given value

@throws RuntimeException if the given value is not positive
common-parent/invariant/src/main/java/com/speedment/common/invariant/DoubleRangeUtil.java