private void tick()
    {
        scheduledFuture = executor.schedule(this::run, delayMillis, MILLISECONDS);
    }
@Test(enabled = false)
    public void testTick()
            throws Exception
    {
        int numberOfTicks = 2;
        long durationBetweenTicksInSeconds = 2;

        CountDownLatch latch = new CountDownLatch(3);
        Runnable runnable = latch::countDown;

        try (PeriodicTaskExecutor executor = new PeriodicTaskExecutor(SECONDS.toMillis(durationBetweenTicksInSeconds), 500, executorService, runnable, i -> i)) {
            executor.start();
            Stopwatch stopwatch = Stopwatch.createStarted();
            latch.await(10, SECONDS);
            stopwatch.stop();

            assertEquals((numberOfTicks * durationBetweenTicksInSeconds), stopwatch.elapsed(SECONDS));
            assertEquals(latch.getCount(), 0); // latch was counted down 3 times
        }
    }