presto-main/src/main/java/io/prestosql/execution/StateMachine.java/StateMachine/isTerminalState
class StateMachine:    @VisibleForTesting
    boolean isTerminalState(T state)
    {
        return terminalStates.contains(state);
    }