Class TestRng

  • public class TestRng
    extends Object
    Toy RNG to ensure we get predictable numbers during unit tests.
    • Constructor Detail

      • TestRng

        public TestRng​(String seed)
        Create a new random number generator, seeded by a string.
        seed - seed to bootstrap, usually this is the test method name.
    • Method Detail

      • nextBytes

        public byte[] nextBytes​(int cnt)
        Get the next cnt bytes of random data.
        cnt - number of random bytes to produce.
        array of cnt randomly generated bytes.
      • nextInt

        public int nextInt()
        Next int
        the next random integer.