public static <W extends BoundedWindow> StateContext<W> windowOnlyContext(W window) {
    return new WindowOnlyContext<>(window);
  }
@Test
  public void windowOnlyContextThrowsOnSideInput() {
    BoundedWindow window = new IntervalWindow(new Instant(-137), Duration.millis(21L));
    StateContext<BoundedWindow> context = StateContexts.windowOnlyContext(window);
    thrown.expect(IllegalArgumentException.class);
    context.sideInput(view);
  }