code: @Override
      public int nextInt(int n) {
          if (n <= 0) {
              throw new IllegalArgumentException("n must be positive");
          }
  
          // the special treatment of powers of 2 as in Random.nextInt(int) shouldn't be necessary
          int bits, val;
          do {
              bits = nextInt() >>> 1;
              val = bits % n;
          } while (bits - val + (n - 1) < 0);
          return val;
      }
docs: Returns the next pseudorandom, approximately uniformly distributed {@code int}
  value between 0 (inclusive) and {@code n} (exclusive).
  
  @see java.util.Random#nextInt(int)