@Test(timeout = 60000)
public void testScheduledExecutorServiceWithFixedDelaySchedule() throws ExecutionException, InterruptedException {

	ScheduledExecutor scheduledExecutor = akkaRpcService.getScheduledExecutor();
	final int tries = 4;
	final long delay = 10L;
	final CountDownLatch countDownLatch = new CountDownLatch(tries);
	long currentTime = System.nanoTime();
	ScheduledFuture<?> future = scheduledExecutor.scheduleWithFixedDelay(
		new Runnable() {
			@Override
			public void run() {
				countDownLatch.countDown();
			}
		},
		delay,
		delay,
		TimeUnit.MILLISECONDS);
	assertTrue(!future.isDone());
	countDownLatch.await();
	// the future should not complete since we have a periodic task
	assertTrue(!future.isDone());
	long finalTime = System.nanoTime() - currentTime;
	// the processing should have taken at least delay times the number of count downs.
	assertTrue(finalTime >= tries * delay);
	future.cancel(true);
}