public function addTransition($stateId, $nextStateId, $eventId)
    {
        $state = $this->stateMachine->getState($stateId);
        if ($state === null) {
            throw new StateNotFoundException(sprintf('The state "%s" is not found.', $stateId));
        }

        $nextState = $this->stateMachine->getState($nextStateId);
        if ($nextState === null) {
            throw new StateNotFoundException(sprintf('The state "%s" is not found.', $nextStateId));
        }

        $event = $state->getTransitionEvent($eventId);
        if ($event === null) {
            $event = new Event($eventId);
        }

        $this->stateMachine->addTransition(new Transition($nextState, $state, $event));
    }