@SuppressWarnings("LongDoubleConversion")
    public static long nextLong(final long startInclusive, final long endExclusive) {
        Validate.isTrue(endExclusive >= startInclusive,
            "Start value must be smaller or equal to end value.");
        Validate.isTrue(startInclusive >= 0, "Both range values must be non-negative.");

        if (startInclusive == endExclusive) {
            return startInclusive;
        }
        return Double.valueOf(nextDouble(startInclusive, endExclusive)).longValue();
    }
Next long and provide long.

@param startInclusive the start inclusive
@param endExclusive   the end exclusive
@return the long
api/cas-server-core-api-util/src/main/java/org/apereo/cas/util/RandomUtils.java