@SuppressWarnings("FieldAccessNotGuarded")
  public T get() {
    return state;
  }
Creates a state machine with the specified initial state and terminal states.

@param name name of this state machine to use in debug statements
@param executor executor for firing state change events; must not be a same thread executor
@param initialState the initial state
@param terminalStates the terminal states
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/execution/StateMachine.java