AfterEachStateMachine extends TriggerStateMachine { @Override public String toString() { StringBuilder builder = new StringBuilder("AfterEach.inOrder("); Joiner.on(", ").appendTo(builder, subTriggers); builder.append(")"); return builder.toString(); } private  AfterEachStateMachine(List<TriggerStateMachine> subTriggers); @SafeVarargs static TriggerStateMachine inOrder(TriggerStateMachine... triggers); static TriggerStateMachine inOrder(Iterable<? extends TriggerStateMachine> triggers); @Override void onElement(OnElementContext c); @Override void onMerge(OnMergeContext context); @Override boolean shouldFire(TriggerStateMachine.TriggerContext context); @Override void onFire(TriggerStateMachine.TriggerContext context); @Override String toString();  }
@Test public void testToString() { TriggerStateMachine trigger = AfterEachStateMachine.inOrder( StubTriggerStateMachine.named("t1"), StubTriggerStateMachine.named("t2"), StubTriggerStateMachine.named("t3")); assertEquals("AfterEach.inOrder(t1, t2, t3)", trigger.toString()); }