public void setCapacity(int capacity) {
        final int oldCapacity = this.capacity;
        this.capacity = capacity;
        final int size = count.get();
        if (capacity > size && size >= oldCapacity) {
            signalNotFull();
        }
    }
@Test
    public void testDecreaseResizableCapacityLinkedBlockingQueue() throws InterruptedException {
        MyRejectedExecutionHandler myRejectedExecutionHandler = new MyRejectedExecutionHandler();
        ResizableCapacityLinkedBlockingQueue<Runnable> queue = new ResizableCapacityLinkedBlockingQueue<>(4);

        ThreadPoolExecutor threadPoolExecutor = new ThreadPoolExecutor(1, 1,
                60, TimeUnit.SECONDS, queue, myRejectedExecutionHandler);
        Assert.assertSame(queue, threadPoolExecutor.getQueue());
        threadPoolExecutor.prestartAllCoreThreads();
        queue.setCapacity(0);
        IntStream.range(0, 4).forEach(s -> {
            threadPoolExecutor.execute(() -> ThreadUtil.sleep(0L));
        });
        threadPoolExecutor.shutdown();
        while (!threadPoolExecutor.isTerminated()) {
        }
        Assert.assertEquals(0, threadPoolExecutor.getCompletedTaskCount());
        Assert.assertEquals(4, myRejectedExecutionHandler.getCount());

    }