HealthCheckRegistry { private void onHealthCheckAdded(String name, HealthCheck healthCheck) { for (HealthCheckRegistryListener listener : listeners) { listener.onHealthCheckAdded(name, healthCheck); } } 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 registeringHealthCheckTriggersNotification() { verify(listener).onHealthCheckAdded("hc1", hc1); verify(listener).onHealthCheckAdded("hc2", hc2); verify(listener).onHealthCheckAdded(eq("ahc"), any(AsyncHealthCheckDecorator.class)); }