@Override
    public ScheduledExecutor getScheduledExecutor() {
        return internalScheduledExecutor;
    }
@Test
    void testScheduledExecutorServiceWithFixedDelaySchedule() throws Exception {
        ScheduledExecutor scheduledExecutor = pekkoRpcService.getScheduledExecutor();

        final int tries = 4;
        final long delay = 10L;
        final CountDownLatch countDownLatch = new CountDownLatch(tries);

        long currentTime = System.nanoTime();

        ScheduledFuture<?> future =
                scheduledExecutor.scheduleWithFixedDelay(
                        countDownLatch::countDown, delay, delay, TimeUnit.MILLISECONDS);

        assertThat((Future) future).isNotDone();

        countDownLatch.await();

        // the future should not complete since we have a periodic task
        assertThat((Future) future).isNotDone();

        long finalTime = System.nanoTime() - currentTime;

        // the processing should have taken at least delay times the number of count downs.
        assertThat(finalTime).isGreaterThanOrEqualTo(tries * delay);

        future.cancel(true);
    }