@Test
  public void testRepeatedExecution() throws InterruptedException {
    ex = new ScheduledThreadPoolExecutorWithKeepAlive(50, 1, TimeUnit.SECONDS,
        Executors.defaultThreadFactory(), null);

    final AtomicInteger counter = new AtomicInteger();
    Runnable run = counter::incrementAndGet;
    ScheduledFuture f = ex.scheduleAtFixedRate(run, 0, 1, TimeUnit.SECONDS);
    await()
        .untilAsserted(
            () -> assertEquals("Task was not executed repeatedly", true, counter.get() > 1));
    await()
        .untilAsserted(() -> assertEquals("The task could not be cancelled", true, f.cancel(true)));
    await()
        .untilAsserted(
            () -> assertEquals("Task was not cancelled within 30 sec", true, f.isCancelled()));
    int oldValue = counter.get();
    Thread.sleep(5000);
    assertEquals("Task was not cancelled", oldValue, counter.get());
  }
time, in nanoseconds, that we should tolerate as slop (evidently needed for windows)
geode-core/src/integrationTest/java/org/apache/geode/internal/ScheduledThreadPoolExecutorWithKeepAliveJUnitTest.java