### Question:
SystemProcessingTimeService extends ProcessingTimeService { @Override public ScheduledFuture<?> scheduleAtFixedRate(ProcessingTimeCallback callback, long initialDelay, long period) { long nextTimestamp = getCurrentProcessingTime() + initialDelay; try { return timerService.scheduleAtFixedRate( new RepeatedTriggerTask(status, task, checkpointLock, callback, nextTimestamp, period), initialDelay, period, TimeUnit.MILLISECONDS); } catch (RejectedExecutionException e) { final int status = this.status.get(); if (status == STATUS_QUIESCED) { return new NeverCompleteFuture(initialDelay); } else if (status == STATUS_SHUTDOWN) { throw new IllegalStateException("Timer service is shut down"); } else { throw e; } } } SystemProcessingTimeService(AsyncExceptionHandler failureHandler, Object checkpointLock);  SystemProcessingTimeService(
			AsyncExceptionHandler task,
			Object checkpointLock,
			ThreadFactory threadFactory); @Override long getCurrentProcessingTime(); @Override ScheduledFuture<?> registerTimer(long timestamp, ProcessingTimeCallback target); @Override ScheduledFuture<?> scheduleAtFixedRate(ProcessingTimeCallback callback, long initialDelay, long period); @Override boolean isTerminated(); @Override void quiesce(); @Override void awaitPendingAfterQuiesce(); @Override void shutdownService(); @Override boolean shutdownAndAwaitPending(long time, TimeUnit timeUnit); @Override boolean shutdownServiceUninterruptible(long timeoutMs);  }### Answer:
@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(); } }
@Test public void testExceptionReportingScheduleAtFixedRate() throws InterruptedException { final AtomicBoolean exceptionWasThrown = new AtomicBoolean(false); final OneShotLatch latch = new OneShotLatch(); final Object lock = new Object(); ProcessingTimeService timeServiceProvider = new SystemProcessingTimeService( new AsyncExceptionHandler() { @Override public void handleAsyncException(String message, Throwable exception) { exceptionWasThrown.set(true); latch.trigger(); } }, lock); timeServiceProvider.scheduleAtFixedRate( new ProcessingTimeCallback() { @Override public void onProcessingTime(long timestamp) throws Exception { throw new Exception("Exception in Timer"); } }, 0L, 100L); latch.await(); assertTrue(exceptionWasThrown.get()); }