code: @Override
      protected final int next(int bits)
      {
          int result;
          try
          {
              lock.lock();
              if (currentBlock == null || currentBlock.length - index < 4)
              {
                  try
                  {
                      currentBlock = nextBlock();
                      index = 0;
                  }
                  catch (GeneralSecurityException ex)
                  {
                      // Should never happen.  If initialisation succeeds without exceptions
                      // we should be able to proceed indefinitely without exceptions.
                      throw new IllegalStateException("Failed creating next random block.", ex);
                  }
              }
              result = BinaryUtils.convertBytesToInt(currentBlock, index);
              index += 4;
          }
          finally
          {
              lock.unlock();
          }
          return result >>> (32 - bits);
      }
docs: {@inheritDoc}