@Test
public void filterOutBatchesNotQueueingForAMinimumPeriod() {

    final Instant now = Instant.ofEpochMilli(testScheduler.now());
    final Instant past = now.minus(ofMinutes(10));
    final Stream<Batch<BatchableOperationMock, String>> batches = Stream.of(
            Batch.of("first",
                    // only has recent items
                    new BatchableOperationMock(LOW, now, "first", "sub1", "some"),
                    new BatchableOperationMock(HIGH, now, "first", "sub2", "some"),
                    new BatchableOperationMock(LOW, now, "first", "sub3", "some")
            ),
            Batch.of("second",
                    new BatchableOperationMock(LOW, now, "second", "sub1", "some"),
                    new BatchableOperationMock(LOW, now, "second", "sub2", "some"),
                    new BatchableOperationMock(HIGH, past, "second", "sub3", "some")
            ),
            Batch.of("third",
                    new BatchableOperationMock(LOW, past, "third", "sub1", "someState")
            )
    );
    EmissionStrategy strategy = new LargestPerTimeBucket(300_000 /* 5min */, NO_BUCKETS, testScheduler);
    Queue<Batch<BatchableOperationMock, String>> toEmit = strategy.compute(batches);
    // first was filtered out
    Assertions.assertThat(toEmit).hasSize(2);
    assertThat(toEmit.poll().getIndex()).isEqualTo("second");
    assertThat(toEmit.poll().getIndex()).isEqualTo("third");
}