public static ThreadPoolExecutor newCachedThreadPool(int corePoolSize,
                                                         int maximumPoolSize) {
        return new ThreadPoolExecutor(corePoolSize,
            maximumPoolSize,
            DateUtils.MILLISECONDS_PER_MINUTE,
            TimeUnit.MILLISECONDS,
            new SynchronousQueue<Runnable>());
    }
@Test
    public void newCachedThreadPool3() 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, queue, factory, handler);
        Assert.assertEquals(executor.getCorePoolSize(), 10);
        Assert.assertEquals(executor.getMaximumPoolSize(), 20);
        Assert.assertEquals(executor.getQueue(), queue);
        Assert.assertEquals(executor.getThreadFactory(), factory);
        Assert.assertEquals(executor.getRejectedExecutionHandler(), handler);
    }