SharedHealthCheckRegistries { public static HealthCheckRegistry getDefault() { final HealthCheckRegistry healthCheckRegistry = tryGetDefault(); if (healthCheckRegistry != null) { return healthCheckRegistry; } throw new IllegalStateException("Default registry name has not been set."); } private  SharedHealthCheckRegistries(); static void clear(); static Set<String> names(); static void remove(String key); static HealthCheckRegistry add(String name, HealthCheckRegistry registry); static HealthCheckRegistry getOrCreate(String name); synchronized static HealthCheckRegistry setDefault(String name); static HealthCheckRegistry setDefault(String name, HealthCheckRegistry healthCheckRegistry); static HealthCheckRegistry getDefault(); static HealthCheckRegistry tryGetDefault();  }
@Test public void defaultRegistryIsNotSetByDefault() { expectedException.expect(IllegalStateException.class); expectedException.expectMessage("Default registry name has not been set."); SharedHealthCheckRegistries.getDefault(); }