public function testFiltersStatesThatHaveNoOutgoingTransitions()
{
$eventName = 'event';
$stateCollection = new StateCollection();
$helper = new SetupHelper($stateCollection);
$helper->findOrCreateTransition('foo', 'bar', $eventName);
$filter = new FilterStateByFinalState($stateCollection->getStates());
$filteredStates = iterator_to_array($filter);
$this->assertContains($stateCollection->getState('bar'), $filteredStates);
$this->assertNotContains($stateCollection->getState('foo'), $filteredStates);
}