HealthCheckRegistry { public HealthCheck getHealthCheck(String name) { return healthChecks.get(name); } HealthCheckRegistry();  HealthCheckRegistry(int asyncExecutorPoolSize);  HealthCheckRegistry(ScheduledExecutorService asyncExecutorService); void addListener(HealthCheckRegistryListener listener); void removeListener(HealthCheckRegistryListener listener); void register(String name, HealthCheck healthCheck); void unregister(String name); SortedSet<String> getNames(); HealthCheck getHealthCheck(String name); HealthCheck.Result runHealthCheck(String name); SortedMap<String, HealthCheck.Result> runHealthChecks(); SortedMap<String, HealthCheck.Result> runHealthChecks(HealthCheckFilter filter); SortedMap<String, HealthCheck.Result> runHealthChecks(ExecutorService executor); SortedMap<String, HealthCheck.Result> runHealthChecks(ExecutorService executor, HealthCheckFilter filter); void shutdown();  }
@Test public void asyncHealthCheckIsScheduledOnExecutor() { ArgumentCaptor<AsyncHealthCheckDecorator> decoratorCaptor = forClass(AsyncHealthCheckDecorator.class); verify(executorService).scheduleAtFixedRate(decoratorCaptor.capture(), eq(0L), eq(10L), eq(TimeUnit.SECONDS)); assertThat(decoratorCaptor.getValue().getHealthCheck()).isEqualTo(ahc); }