public static Sessions withGapDuration(Duration gapDuration) {
    return new Sessions(gapDuration);
  }
@Test
  public void testInvalidOutputAtEarliest() throws Exception {
    try {
      WindowFnTestUtils.validateGetOutputTimestamps(
          Sessions.withGapDuration(Duration.millis(10)),
          TimestampCombiner.EARLIEST,
          ImmutableList.of(
              (List<Long>) ImmutableList.of(1L, 3L),
              (List<Long>) ImmutableList.of(0L, 5L, 10L, 15L, 20L)));
    } catch (AssertionError exc) {
      assertThat(
          exc.getMessage(),
          // These are the non-volatile pieces of the error message that a timestamp
          // was not greater than what it should be.
          allOf(containsString("a value greater than"), containsString("was less than")));
    }
  }