OrFinallyStateMachine extends TriggerStateMachine { @Override public String toString() { return String.format("%s.orFinally(%s)", subTriggers.get(ACTUAL), subTriggers.get(UNTIL)); } @VisibleForTesting  OrFinallyStateMachine(TriggerStateMachine actual, TriggerStateMachine until); @Override void onElement(OnElementContext c); @Override void onMerge(OnMergeContext c); @Override boolean shouldFire(TriggerStateMachine.TriggerContext context); @Override void onFire(TriggerStateMachine.TriggerContext context); @Override String toString();  }
@Test public void testToString() { TriggerStateMachine trigger = StubTriggerStateMachine.named("t1").orFinally(StubTriggerStateMachine.named("t2")); assertEquals("t1.orFinally(t2)", trigger.toString()); }