@Override
    public void execute(Runnable command) {
        if (command == null) {
            throw new NullPointerException();
        }

        try {
            super.execute(command);
        } catch (RejectedExecutionException rx) {
            // retry to offer the task into queue.
            final TaskQueue queue = (TaskQueue) super.getQueue();
            try {
                if (!queue.retryOffer(command, 0, TimeUnit.MILLISECONDS)) {
                    throw new RejectedExecutionException("Queue capacity is full.", rx);
                }
            } catch (InterruptedException x) {
                throw new RejectedExecutionException(x);
            }
        }
    }
@Test
    void testEagerThreadPoolFast() {
        String name = "eager-tf";
        int queues = 5;
        int cores = 5;
        int threads = 10;
        // alive 1 second
        long alive = 1000;

        // init queue and executor
        TaskQueue<Runnable> taskQueue = new TaskQueue<>(queues);
        final EagerThreadPoolExecutor executor = new EagerThreadPoolExecutor(
                cores,
                threads,
                alive,
                TimeUnit.MILLISECONDS,
                taskQueue,
                new NamedThreadFactory(name, true),
                new AbortPolicyWithReport(name, URL));
        taskQueue.setExecutor(executor);

        CountDownLatch countDownLatch1 = new CountDownLatch(1);
        for (int i = 0; i < 10; i++) {
            executor.execute(() -> {
                try {
                    countDownLatch1.await();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            });
        }
        await().until(() -> executor.getPoolSize() == 10);
        Assertions.assertEquals(10, executor.getActiveCount());

        CountDownLatch countDownLatch2 = new CountDownLatch(1);
        AtomicBoolean started = new AtomicBoolean(false);
        for (int i = 0; i < 5; i++) {
            executor.execute(() -> {
                started.set(true);
                try {
                    countDownLatch2.await();
                } catch (InterruptedException e) {
                    throw new RuntimeException(e);
                }
            });
        }

        await().until(() -> executor.getQueue().size() == 5);
        Assertions.assertEquals(10, executor.getActiveCount());
        Assertions.assertEquals(10, executor.getPoolSize());
        Assertions.assertFalse(started.get());
        countDownLatch1.countDown();

        await().until(() -> executor.getActiveCount() == 5);
        Assertions.assertTrue(started.get());

        countDownLatch2.countDown();
        await().until(() -> executor.getActiveCount() == 0);

        await().until(() -> executor.getPoolSize() == cores);
    }