@Override
  public boolean shouldFire(TriggerStateMachine.TriggerContext context) throws Exception {
    return context.trigger().subTrigger(ACTUAL).invokeShouldFire(context)
        || context.trigger().subTrigger(UNTIL).invokeShouldFire(context);
  }
@Test
  public void testActualFiresOnly() throws Exception {
    tester =
        TriggerStateMachineTester.forTrigger(
            new OrFinallyStateMachine(
                RepeatedlyStateMachine.forever(AfterPaneStateMachine.elementCountAtLeast(2)),
                AfterPaneStateMachine.elementCountAtLeast(100)),
            FixedWindows.of(Duration.millis(100)));

    IntervalWindow window = new IntervalWindow(new Instant(0), new Instant(100));

    // Not yet firing
    tester.injectElements(1);
    assertFalse(tester.shouldFire(window));
    assertFalse(tester.isMarkedFinished(window));

    // The actual fires but does not finish
    tester.injectElements(2);
    assertTrue(tester.shouldFire(window));
    tester.fireIfShouldFire(window);
    assertFalse(tester.isMarkedFinished(window));

    // And again
    tester.injectElements(3, 4);
    assertTrue(tester.shouldFire(window));
    tester.fireIfShouldFire(window);
    assertFalse(tester.isMarkedFinished(window));
  }