public static InstrumentedThreadFactory defaultThreadFactory(MetricRegistry registry, String name) {
        return new InstrumentedThreadFactory(Executors.defaultThreadFactory(), registry, name);
    }
@Test
    public void testDefaultThreadFactoryWithName() throws Exception {
        final ThreadFactory threadFactory = InstrumentedExecutors.defaultThreadFactory(registry, "tf");
        threadFactory.newThread(new NoopRunnable());

        assertThat(registry.meter("tf.created").getCount()).isEqualTo(1L);

        final Field delegateField = InstrumentedThreadFactory.class.getDeclaredField("delegate");
        delegateField.setAccessible(true);
        final ThreadFactory delegate = (ThreadFactory) delegateField.get(threadFactory);
        assertThat(delegate.getClass().getCanonicalName()).isEqualTo("java.util.concurrent.Executors.DefaultThreadFactory");
    }