@Override
    public void beforeRejectedExecution(Runnable r, ThreadPoolExecutor executor) {
        rejectCount.incrementAndGet();
    }
@Test
    public void testBeforeRejectedExecution() {
        ExtensibleThreadPoolExecutor executor = new ExtensibleThreadPoolExecutor(
                "test", new DefaultThreadPoolPluginManager(),
                1, 1, 1000L, TimeUnit.MILLISECONDS,
                new ArrayBlockingQueue<>(1), Thread::new, new ThreadPoolExecutor.DiscardPolicy());

        TaskRejectCountRecordPlugin plugin = new TaskRejectCountRecordPlugin();
        executor.register(plugin);
        executor.submit(() -> ThreadUtil.sleep(500L));
        executor.submit(() -> ThreadUtil.sleep(500L));
        executor.submit(() -> ThreadUtil.sleep(500L));

        ThreadUtil.sleep(500L);
        Assert.assertEquals((Long) 1L, plugin.getRejectCountNum());
    }