public function getTransitionByStartingStateAndTransitionName(
        $stateName,
        $transitionName
    ) {
        $transition = array_filter(
            $this->transitions,
            function (Transition $transition) use ($stateName, $transitionName) {
                return
                    $transition->getName() === $transitionName &&
                    $transition->getStart()->getName() === $stateName;
            }
        );

        return !empty($transition)
            ? reset($transition)
            : null;
    }