public static Sessions withGapDuration(Duration gapDuration) {
    return new Sessions(gapDuration);
  }
@Test
  public void testConsecutive() throws Exception {
    Map<IntervalWindow, Set<String>> expected = new HashMap<>();
    expected.put(new IntervalWindow(new Instant(1), new Instant(19)), set(1, 2, 5, 9));
    expected.put(new IntervalWindow(new Instant(100), new Instant(111)), set(100, 101));
    assertEquals(
        expected,
        runWindowFn(
            Sessions.withGapDuration(Duration.millis(10)),
            Arrays.asList(1L, 2L, 5L, 9L, 100L, 101L)));
  }