NeverStateMachine extends TriggerStateMachine { @Override public boolean shouldFire(TriggerStateMachine.TriggerContext context) { return false; } private  NeverStateMachine(); static NeverStateMachine ever(); @Override void onElement(OnElementContext c); @Override void onMerge(OnMergeContext c); @Override boolean shouldFire(TriggerStateMachine.TriggerContext context); @Override void onFire(TriggerStateMachine.TriggerContext context);  }
@Test public void falseAfterEndOfWindow() throws Exception { triggerTester.injectElements(TimestampedValue.of(1, new Instant(1))); IntervalWindow window = new IntervalWindow(new Instant(0), new Instant(0).plus(Duration.standardMinutes(5))); assertThat(triggerTester.shouldFire(window), is(false)); triggerTester.advanceInputWatermark(BoundedWindow.TIMESTAMP_MAX_VALUE); assertThat(triggerTester.shouldFire(window), is(false)); }