code: @Override
      public int next(int bits)
      {
          int result;
          try
          {
              lock.lock();
              // Set cell addresses using address of current cell.
              int cellC = currentCellIndex - 1;
              int cellB = cellC - 1;
              int cellA = cellB - 1;
  
              // Update cell states using rule table.
              cells[currentCellIndex] = RNG_RULE[cells[cellC] + cells[currentCellIndex]];
              cells[cellC] = RNG_RULE[cells[cellB] + cells[cellC]];
              cells[cellB] = RNG_RULE[cells[cellA] + cells[cellB]];
  
              // Update the state of cellA and shift current cell to the left by 4 bytes.
              if (cellA == 0)
              {
                  cells[cellA] = RNG_RULE[cells[cellA]];
                  currentCellIndex = AUTOMATON_LENGTH - 1;
              }
              else
              {
                  cells[cellA] = RNG_RULE[cells[cellA - 1] + cells[cellA]];
                  currentCellIndex -= 4;
              }
              result = convertCellsToInt(cells, cellA);
          }
          finally
          {
              lock.unlock();
          }
          return result >>> (32 - bits);
      }
docs: {@inheritDoc}