public static FromEndOfWindow pastEndOfWindow() {
    return new FromEndOfWindow();
  }
@Test
  public void testEarlyAndAtWatermarkAndLate() throws Exception {
    tester =
        TriggerStateMachineTester.forTrigger(
            AfterWatermarkStateMachine.pastEndOfWindow()
                .withEarlyFirings(mockEarly)
                .withLateFirings(mockLate),
            FixedWindows.of(Duration.millis(100)));

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

    testRunningAsTrigger(mockEarly, window);

    // Fire due to watermark
    when(mockEarly.shouldFire(anyTriggerContext())).thenReturn(false);
    tester.advanceInputWatermark(new Instant(100));
    assertTrue(tester.shouldFire(window));
    tester.fireIfShouldFire(window);
    assertFalse(tester.isMarkedFinished(window));

    testRunningAsTrigger(mockLate, window);
  }