SharedMetricRegistries { public static MetricRegistry getDefault() { MetricRegistry metricRegistry = tryGetDefault(); if (metricRegistry == null) { throw new IllegalStateException("Default registry name has not been set."); } return metricRegistry; } private  SharedMetricRegistries(); static void clear(); static Set<String> names(); static void remove(String key); static MetricRegistry add(String name, MetricRegistry registry); static MetricRegistry getOrCreate(String name); synchronized static MetricRegistry setDefault(String name); static MetricRegistry setDefault(String name, MetricRegistry metricRegistry); static MetricRegistry getDefault(); static MetricRegistry tryGetDefault();  }
@Test public void errorsWhenDefaultUnset() { exception.expect(IllegalStateException.class); exception.expectMessage("Default registry name has not been set."); SharedMetricRegistries.getDefault(); }