@Test(timeout = 10000)
public void testScheduleAtFixedRate() throws Exception {

	final Object lock = new Object();
	final AtomicReference<Throwable> errorRef = new AtomicReference<>();
	final long period = 10L;
	final int countDown = 3;
	final SystemProcessingTimeService timer = new SystemProcessingTimeService(
		new ReferenceSettingExceptionHandler(errorRef), lock);
	final CountDownLatch countDownLatch = new CountDownLatch(countDown);
	try {
		timer.scheduleAtFixedRate(new ProcessingTimeCallback() {
			@Override
			public void onProcessingTime(long timestamp) throws Exception {
				countDownLatch.countDown();
			}
		}, 0L, period);
		countDownLatch.await();
		if (errorRef.get() != null) {
			throw new Exception(errorRef.get());
		}
	} finally {
		timer.shutdownService();
	}
}