public void mockNextInt(int returnValue) {
        this.nextIntFunction = __ -> OptionalInt.of(returnValue);
    }
A Random instance that makes it easy to modify the behavior of certain methods for test purposes.
raft/src/test/java/org/apache/kafka/raft/MockableRandom.java