code: public boolean nextIndex(long index) {
      if (operationIndex + 1 == index) {
        currentOperation = OperationType.COMMAND;
        operationIndex++;
        return true;
      }
      return false;
    }
docs: Increments the current index and returns true if the given index is the next index.
  
  @param index the index to which to increment the current index
  @return indicates whether the current index was successfully incremented