@Override
    public void execute(final Runnable command) {
        if (Objects.isNull(command)) {
            throw new NullPointerException();
        }

        try {
            super.execute(command);
        } catch (RejectedExecutionException e) {
            // retry to offer the task into queue.
            final TaskQueue<Runnable> queue = (TaskQueue<Runnable>) super.getQueue();
            try {
                if (!queue.retryOffer(command, 0, TimeUnit.MILLISECONDS)) {
                    throw new RejectedExecutionException("Queue capacity is full.", e);
                }
            } catch (InterruptedException t) {
                throw new RejectedExecutionException(t);
            }
        }
    }
@Test
    public void testNullCommand() {
        ShenyuThreadPoolExecutor executor = getTestExecutor(new MemoryLimitedTaskQueue<>(instrumentation));
        assertThrows(NullPointerException.class, () -> executor.execute(null));
    }