--- jsr166/src/jdk8/java/util/SplittableRandom.java 2016/03/26 06:22:49 1.1 +++ jsr166/src/jdk8/java/util/SplittableRandom.java 2016/11/14 16:49:56 1.2 @@ -531,6 +531,19 @@ public final class SplittableRandom { } /** + * Generates a pseudorandom number with the indicated number of + * low-order bits. Because this class has no subclasses, this + * method cannot be invoked or overridden. + * + * @param bits random bits + * @return the next pseudorandom value from this random number + * generator's sequence + */ + protected int next(int bits) { + return nextInt() >>> (32 - bits); + } + + /** * Returns a pseudorandom {@code double} value between the specified * origin (inclusive) and bound (exclusive). *