RepeatedlyStateMachine extends TriggerStateMachine { @Override public String toString() { return String.format("Repeatedly.forever(%s)", subTriggers.get(REPEATED)); } private  RepeatedlyStateMachine(TriggerStateMachine repeated); static RepeatedlyStateMachine forever(TriggerStateMachine repeated); @Override void onElement(OnElementContext c); @Override void onMerge(OnMergeContext c); @Override boolean shouldFire(TriggerStateMachine.TriggerContext context); @Override void onFire(TriggerContext context); @Override String toString();  }
@Test public void testToString() { TriggerStateMachine trigger = RepeatedlyStateMachine.forever( new StubTriggerStateMachine() { @Override public String toString() { return "innerTrigger"; } }); assertEquals("Repeatedly.forever(innerTrigger)", trigger.toString()); }