public static MetricRegistry getDefault() {
        if (defaultRegistryName != null) {
            return getOrCreate(defaultRegistryName);
        }
        throw new IllegalStateException("Default registry name has not been set.");
    }
@Test
    public void errorsWhenDefaultUnset() throws Exception {
        try {
            SharedMetricRegistries.getDefault();
        } catch (final Exception e) {
            assertThat(e).isInstanceOf(IllegalStateException.class);
            assertThat(e.getMessage()).isEqualTo("Default registry name has not been set.");
        }
    }