statefun-e2e-tests/statefun-smoke-e2e/src/main/java/org/apache/flink/statefun/e2e/smoke/FunctionStateTracker.java
/**
   * Recursively traverse the commands tree and look for {@link Command.IncrementState} commands.
   * For each {@code ModifyState} command found update the corresponding expected state.
   */
Recursively traverse the commands tree and look for  Command.IncrementState commands.
For each  ModifyState command found update the corresponding expected state.
Recursively traverse the commands tree and look for Command . IncrementState commands . For each ModifyState command found update the corresponding expected state .
private void updateInternally(int currentAddress, Commands commands) {
    for (Command command : commands.getCommandList()) {
      if (command.hasIncrement()) {
        expectedStates[currentAddress]++;
      } else if (command.hasSend()) {
        updateInternally(command.getSend().getTarget(), command.getSend().getCommands());
      } else if (command.hasSendAfter()) {
        updateInternally(command.getSendAfter().getTarget(), command.getSendAfter().getCommands());
      } else if (command.hasAsyncOperation()) {
        updateInternally(currentAddress, command.getAsyncOperation().getResolvedCommands());
      }
    }
  }
private void updateInternally ( int currentAddress , Commands commands ) { for ( Command command : commands . getCommandList ( ) ) { if ( command . hasIncrement ( ) ) { expectedStates [ currentAddress ] ++ ; } else if ( command . hasSend ( ) ) { updateInternally ( command . getSend ( ) . getTarget ( ) , command . getSend ( ) . getCommands ( ) ) ; } else if ( command . hasSendAfter ( ) ) { updateInternally ( command . getSendAfter ( ) . getTarget ( ) , command . getSendAfter ( ) . getCommands ( ) ) ; } else if ( command . hasAsyncOperation ( ) ) { updateInternally ( currentAddress , command . getAsyncOperation ( ) . getResolvedCommands ( ) ) ; } } }
Recursively traverse the commands tree and look for {@link Command.IncrementState} commands.
Recursively traverse the commands tree and look for { @link Command . IncrementState } commands .