@Test
public void testWithPriority() {

    ThreadFactory threadFactory = ThreadFactoryBuilder.create().withPriority(Thread.MIN_PRIORITY).build();
    assertThat(threadFactory.newThread(TEST_RUNNABLE).getPriority(), is(Thread.MIN_PRIORITY));
    threadFactory = ThreadFactoryBuilder.create().withPriority(Thread.MAX_PRIORITY).build();
    assertThat(threadFactory.newThread(TEST_RUNNABLE).getPriority(), is(Thread.MAX_PRIORITY));
}