public function getTransitionsByFinalState($stateName)
    {
        return array_filter(
            $this->transitions,
            function (Transition $transition) use ($stateName) {
                return $transition
                    ->getFinal()
                    ->getName() === $stateName;
            }
        );
    }