@Test
public void testWithDaemonThreads() {

    ThreadFactory threadFactory = ThreadFactoryBuilder.create().withDaemonThreads(true).build();
    assertThat(threadFactory.newThread(TEST_RUNNABLE).isDaemon(), is(true));
    threadFactory = ThreadFactoryBuilder.create().withDaemonThreads(false).build();
    assertThat(threadFactory.newThread(TEST_RUNNABLE).isDaemon(), is(false));
}