@Test
public void testThreadProperties() {

    final AtomicReference<Thread> threadRef = new AtomicReference<Thread>();
    SingleThreadEventExecutor executor = new SingleThreadEventExecutor(
            null, new DefaultThreadFactory("test"), false) {
        @Override
        protected void run() {
            threadRef.set(Thread.currentThread());
            while (!confirmShutdown()) {
                Runnable task = takeTask();
                if (task != null) {
                    task.run();
                }
            }
        }
    };
    ThreadProperties threadProperties = executor.threadProperties();
    Thread thread = threadRef.get();
    Assert.assertEquals(thread.getId(), threadProperties.id());
    Assert.assertEquals(thread.getName(), threadProperties.name());
    Assert.assertEquals(thread.getPriority(), threadProperties.priority());
    Assert.assertEquals(thread.isAlive(), threadProperties.isAlive());
    Assert.assertEquals(thread.isDaemon(), threadProperties.isDaemon());
    Assert.assertTrue(threadProperties.stackTrace().length > 0);
    executor.shutdownGracefully();
}