public Future<?> scheduleWithFixedDelay(Runnable task, long initialDelay, long delay, TimeUnit unit) {
        Preconditions.checkState(isOpen.get(), "CloseableExecutorService is closed");

        ScheduledFuture<?> scheduledFuture =
                scheduledExecutorService.scheduleWithFixedDelay(task, initialDelay, delay, unit);
        return new InternalScheduledFutureTask(scheduledFuture);
    }
@Test
    public void testCloseableScheduleWithFixedDelayAndAdditionalTasks() throws InterruptedException {
        final AtomicInteger outerCounter = new AtomicInteger(0);
        Runnable command = new Runnable() {
            @Override
            public void run() {
                outerCounter.incrementAndGet();
            }
        };
        executorService.scheduleWithFixedDelay(command, DELAY_MS, DELAY_MS, TimeUnit.MILLISECONDS);

        CloseableScheduledExecutorService service = new CloseableScheduledExecutorService(executorService);

        final AtomicInteger innerCounter = new AtomicInteger(0);
        service.scheduleWithFixedDelay(
                new Runnable() {
                    @Override
                    public void run() {
                        innerCounter.incrementAndGet();
                    }
                },
                DELAY_MS,
                DELAY_MS,
                TimeUnit.MILLISECONDS);

        Thread.sleep(DELAY_MS * 4);

        service.close();
        Thread.sleep(DELAY_MS * 2);

        int innerValue = innerCounter.get();
        assertTrue(innerValue > 0);

        int value = outerCounter.get();
        Thread.sleep(DELAY_MS * 2);
        int newValue = outerCounter.get();
        assertTrue(newValue > value);
        assertEquals(innerValue, innerCounter.get());

        value = newValue;
        Thread.sleep(DELAY_MS * 2);
        newValue = outerCounter.get();
        assertTrue(newValue > value);
        assertEquals(innerValue, innerCounter.get());
    }