@Test public void testFireDeadline() throws Exception { BoundedWindow window = new IntervalWindow(new Instant(0), new Instant(10)); assertEquals( new Instant(9), Repeatedly.forever(AfterWatermark.pastEndOfWindow()) .getWatermarkThatGuaranteesFiring(window)); assertEquals( new Instant(9), Repeatedly.forever(AfterWatermark.pastEndOfWindow()) .orFinally(AfterPane.elementCountAtLeast(1)) .getWatermarkThatGuaranteesFiring(window)); assertEquals( new Instant(9), Repeatedly.forever(AfterPane.elementCountAtLeast(1)) .orFinally(AfterWatermark.pastEndOfWindow()) .getWatermarkThatGuaranteesFiring(window)); assertEquals( new Instant(9), AfterPane.elementCountAtLeast(100) .orFinally(AfterWatermark.pastEndOfWindow()) .getWatermarkThatGuaranteesFiring(window)); assertEquals( BoundedWindow.TIMESTAMP_MAX_VALUE, Repeatedly.forever(AfterPane.elementCountAtLeast(1)) .orFinally(AfterPane.elementCountAtLeast(10)) .getWatermarkThatGuaranteesFiring(window)); }