public static double requireNegative(double val) {
        if (Double.compare(val, 0d) >= 0) {
            throw new IllegalArgumentException(val + IS_NOT_NEGATIVE);
        }
        return val;
    }
Returns the given value if it is negative (less than {@code 0}).

@param val  to check
@return     the given value

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