return ret;
long mask = (1L << numBits) - 1; return (int) (ret & mask);
  protected final int next(int numBits)  {    if (numBits == 0)      return 0;    byte tmp[] = new byte[numBits / 8 + (1 * (numBits % 8))];    secureRandomSpi.engineNextBytes(tmp);    randomBytesUsed += tmp.length;    counter++;    int ret = 0;    for (int i = 0; i < tmp.length; i++)      ret |= tmp[i] << (8 * i);    return ret;  }