@Test
public void testWithUncaughtExceptionHandler() {

    UncaughtExceptionHandler handler = new UncaughtExceptionHandler() {
        @Override
        public void uncaughtException(Thread t, Throwable e) {
        }
    };
    ThreadFactory threadFactory = ThreadFactoryBuilder.create().withUncaughtExceptionHandler(handler).build();
    assertThat(threadFactory.newThread(TEST_RUNNABLE).getUncaughtExceptionHandler(), is(handler));
}