Sessions extends WindowFn<Object, IntervalWindow> { @Override public void verifyCompatibility(WindowFn<?, ?> other) throws IncompatibleWindowException { if (!this.isCompatible(other)) { throw new IncompatibleWindowException( other, String.format( "%s is only compatible with %s.", Sessions.class.getSimpleName(), Sessions.class.getSimpleName())); } } private  Sessions(Duration gapDuration); static Sessions withGapDuration(Duration gapDuration); @Override Collection<IntervalWindow> assignWindows(AssignContext c); @Override void mergeWindows(MergeContext c); @Override Coder<IntervalWindow> windowCoder(); @Override boolean isCompatible(WindowFn<?, ?> other); @Override void verifyCompatibility(WindowFn<?, ?> other); @Override TypeDescriptor<IntervalWindow> getWindowTypeDescriptor(); @Override WindowMappingFn<IntervalWindow> getDefaultWindowMappingFn(); Duration getGapDuration(); @Override void populateDisplayData(DisplayData.Builder builder); @Override boolean equals(@Nullable Object object); @Override int hashCode();  }
@Test public void testVerifyCompatibility() throws IncompatibleWindowException { Sessions.withGapDuration(new Duration(10)) .verifyCompatibility(Sessions.withGapDuration(new Duration(10))); thrown.expect(IncompatibleWindowException.class); Sessions.withGapDuration(new Duration(10)) .verifyCompatibility(FixedWindows.of(new Duration(10))); }