@Override
    public Optional<Period> chooseBin(final List<Period> availablePeriods, final QueryExecutionStats stats) {
        return availablePeriods.stream()
                .filter(per -> matches(per, stats.effectiveTimeRange()))
                .findFirst();
    }
@Test
    void testChoosesProperPeriod() {
        final Optional<Period> chosenPeriod = toTest.chooseBin(
                List.of(Period.days(1), Period.days(2), Period.days(3)),
                getQueryExecutionStats(42, AbsoluteRange.create(
                        DateTime.now(DateTimeZone.UTC).minusDays(1).minusHours(23),
                        DateTime.now(DateTimeZone.UTC))
                )
        );
        assertTrue(chosenPeriod.isPresent());
        assertEquals(chosenPeriod.get(), Period.days(2));
    }