@Override
    public void rotate(IndexSet indexSet) {
        indexRotator.rotate(indexSet, this::shouldRotate);
    }
@Test
    public void testRotationOnEmptyIndexSetWhenEnabled() {
        final DateTime initialTime = new DateTime(2022, 7, 21, 13, 00, 00, 0, DateTimeZone.UTC);
        final Period period = hours(1);
        final InstantMillisProvider clock = new InstantMillisProvider(initialTime);
        DateTimeUtils.setCurrentMillisProvider(clock);

        when(indexSet.getConfig()).thenReturn(indexSetConfig);
        when(indexSetConfig.rotationStrategyConfig()).thenReturn(TimeBasedRotationStrategyConfig.builder().rotateEmptyIndexSet(true).rotationPeriod(period).build());
        when(indices.indexCreationDate(anyString())).thenReturn(Optional.of(initialTime.minus(minutes(11))));

        when(indexSet.getNewestIndex()).thenReturn(IGNORED);
        when(indexSet.getConfig()).thenReturn(indexSetConfig);

        when(indices.numberOfMessages(anyString())).thenReturn(0L);
        when(indices.getIndices(eq(indexSet))).thenReturn(ImmutableSet.of("emptyIndex", IGNORED));
        clock.tick(minutes(60));
        rotationStrategy.rotate(indexSet);
        verify(indexSet, times(1)).cycle();
    }