TriggerStateMachine implements Serializable { @Override public String toString() { String simpleName = getClass().getSimpleName(); if (getClass().getEnclosingClass() != null) { simpleName = getClass().getEnclosingClass().getSimpleName() + "." + simpleName; } if (subTriggers == null || subTriggers.isEmpty()) { return simpleName; } else { return simpleName + "(" + Joiner.on(", ").join(subTriggers) + ")"; } } protected  TriggerStateMachine(@Nullable List<TriggerStateMachine> subTriggers); abstract void onElement(OnElementContext c); abstract void onMerge(OnMergeContext c); abstract boolean shouldFire(TriggerContext context); abstract void onFire(TriggerContext context); void prefetchOnElement(StateAccessor<?> state); void prefetchOnMerge(MergingStateAccessor<?, ?> state); void prefetchShouldFire(StateAccessor<?> state); void prefetchOnFire(StateAccessor<?> state); void clear(TriggerContext c); Iterable<TriggerStateMachine> subTriggers(); boolean isCompatible(TriggerStateMachine other); @Override String toString(); @Override boolean equals(@Nullable Object obj); @Override int hashCode(); TriggerStateMachine orFinally(TriggerStateMachine until);  }
@Test public void testTriggerToString() throws Exception { assertEquals( "AfterWatermark.pastEndOfWindow()", AfterWatermarkStateMachine.pastEndOfWindow().toString()); assertEquals( "Repeatedly.forever(AfterWatermark.pastEndOfWindow())", RepeatedlyStateMachine.forever(AfterWatermarkStateMachine.pastEndOfWindow()).toString()); }