FixedWindows extends PartitioningWindowFn<Object, IntervalWindow> { @Override public void verifyCompatibility(WindowFn<?, ?> other) throws IncompatibleWindowException { if (!this.isCompatible(other)) { throw new IncompatibleWindowException( other, String.format( "Only %s objects with the same size and offset are compatible.", FixedWindows.class.getSimpleName())); } } private  FixedWindows(Duration size, Duration offset); static FixedWindows of(Duration size); FixedWindows withOffset(Duration offset); @Override IntervalWindow assignWindow(Instant timestamp); @Override void populateDisplayData(DisplayData.Builder builder); @Override Coder<IntervalWindow> windowCoder(); @Override boolean isCompatible(WindowFn<?, ?> other); @Override void verifyCompatibility(WindowFn<?, ?> other); Duration getSize(); Duration getOffset(); @Override boolean equals(@Nullable Object object); @Override int hashCode();  }
@Test public void testVerifyCompatibility() throws IncompatibleWindowException { FixedWindows.of(new Duration(10)).verifyCompatibility(FixedWindows.of(new Duration(10))); thrown.expect(IncompatibleWindowException.class); FixedWindows.of(new Duration(10)).verifyCompatibility(FixedWindows.of(new Duration(20))); }