public function setEndState($stateId, $eventId)
    {
        if ($this->stateMachine->getState(StateMachine::STATE_FINAL) === null) {
            $this->stateMachine->addState(new FinalState(StateMachine::STATE_FINAL));
        }

        $this->addTransition($stateId, StateMachine::STATE_FINAL, $eventId);
    }