@Test
public void testNamedDeamonThreadFactory() throws Exception {

  final ThreadFactory deamons = ThreadFactories.deamons("Test");
  assertThat(deamons, sameInstance(ThreadFactories.deamons("Test")));
  assertThat(deamons.newThread(mock(Runnable.class)).getName(), equalTo("Test-1-Daemon"));
  assertThat(deamons.newThread(mock(Runnable.class)).getName(), equalTo("Test-2-Daemon"));
  assertThat(deamons.newThread(mock(Runnable.class)).getName(), equalTo("Test-3-Daemon"));
  testDeamonThreadFactory(deamons);
}