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());
sm.handle(new Event("foo", context));
assertEquals(true, context.getAttribute("success"));
}