@Test
public void newCachedThreadPool4() throws Exception {

    BlockingQueue<Runnable> queue = new SynchronousQueue<Runnable>();
    RejectedExecutionHandler handler = new RejectedExecutionHandler() {
        @Override
        public void rejectedExecution(Runnable r, ThreadPoolExecutor executor) {
        }
    };
    ThreadFactory factory = new NamedThreadFactory("xxx");
    ThreadPoolExecutor executor = ThreadPoolUtils.newCachedThreadPool(10, 20, 45678, queue, factory, handler);
    Assert.assertEquals(executor.getCorePoolSize(), 10);
    Assert.assertEquals(executor.getMaximumPoolSize(), 20);
    Assert.assertEquals(executor.getQueue(), queue);
    Assert.assertEquals(executor.getKeepAliveTime(TimeUnit.MILLISECONDS), 45678);
    Assert.assertEquals(executor.getThreadFactory(), factory);
    Assert.assertEquals(executor.getRejectedExecutionHandler(), handler);
}