RepeatedlyStateMachine extends TriggerStateMachine { @Override public boolean shouldFire(TriggerStateMachine.TriggerContext context) throws Exception { return getRepeated(context).invokeShouldFire(context); } 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 testShouldFire() throws Exception { setUp(FixedWindows.of(Duration.millis(10))); when(mockTrigger.shouldFire(anyTriggerContext())).thenReturn(true); assertTrue(tester.shouldFire(new IntervalWindow(new Instant(0), new Instant(10)))); when(mockTrigger.shouldFire(Mockito.any())).thenReturn(false); assertFalse(tester.shouldFire(new IntervalWindow(new Instant(0), new Instant(10)))); }