@Test
    void ensureAllTransitionDestinationsExistInFlow() {
        val registry = getMultifactorFlowDefinitionRegistry();
        assertTrue(registry.containsFlowDefinition(getMultifactorEventId()));
        val flow = (Flow) registry.getFlowDefinition(getMultifactorEventId());
        val states = Arrays.asList(flow.getStateIds());
        states.forEach(stateId -> {
            val state = (State) flow.getState(stateId);
            if (state instanceof final TransitionableState transitionableState) {
                transitionableState.getTransitionSet().forEach(t -> assertTrue(flow.containsState(t.getTargetStateId()),
                    () -> String.format("Destination of transition [%s]-%s->[%s] must be in flow definition",
                        stateId, t.getId(), t.getTargetStateId())));
            }
        });
    }
Ensures that, for every transition within this MFA flow, the target
state is present within the flow.
core/cas-server-core-webflow-mfa-api/src/test/java/org/apereo/cas/web/flow/configurer/BaseMultifactorWebflowConfigurerTests.java