sm.handle(new Event("foo", context));
assertEquals(true, context.getAttribute("success"));
}
public void testBreakAndGotoNext() throws Exception {
State s1 = new State("s1");
State s2 = new State("s2");
s1.addTransition(new BreakAndGotoNextTransition("foo", "s2"));
s2.addTransition(new SuccessTransition("foo"));
StateContext context = new DefaultStateContext();
StateMachine sm = new StateMachine(new State[] { s1, s2 }, "s1");
sm.handle(new Event("foo", context));
assertSame(s2, context.getCurrentState());