@Override
    public Optional<Period> chooseBin(final List<Period> availablePeriods, final QueryExecutionStats stats) {
        return availablePeriods.stream()
                .filter(per -> matches(per, stats.effectiveTimeRange()))
                .findFirst();
    }
@Test
    void testReturnsEmptyOptionalWhenRangeExceedsLongestPeriod() {
        assertTrue(
                toTest.chooseBin(
                        List.of(Period.days(1), Period.days(2)),
                        getQueryExecutionStats(13, AbsoluteRange.create(
                                DateTime.now(DateTimeZone.UTC).minusDays(2).minusHours(1),
                                DateTime.now(DateTimeZone.UTC))
                        )
                ).isEmpty());
    }