@Test(expected = ValidationException.class)
    public void parallelState_BranchContainsChoiceStateWithClosedCycle_IsNotValid() {
        assertCycle(
                stateMachine()
                        .startAt("Initial")
                        .state("Initial", passState()
                                .transition(next("Choice")))
                        .state("Choice", choiceState()
                                .defaultStateName("Terminal")
                                .choice(choice()
                                                .transition(next("Terminal"))
                                                .condition(eq("$.foo", "bar")))
                                .choice(choice()
                                                .transition(next("NonTerminal"))
                                                .condition(eq("$.foo", "bar"))))
                        .state("Terminal", passState().transition(end()))
                        .state("NonTerminal", passState().transition(next("Cyclic")))
                        .state("Cyclic", passState().transition(next("NonTerminal"))));
    }
While the nested ChoiceTwo state only has cycles, it has a cycle out of the choice state to
a state that contains a path to a terminal. The validator doesn't validate that the path out actually
has a path to the terminal so there are some invalid state machines that will pass validation.
aws-java-sdk-stepfunctions/src/test/java/com/amazonaws/services/stepfunctions/builder/internal/validation/CycleTest.java