public DefaultThreadPoolPluginManager setPluginComparator(@NonNull Comparator<Object> comparator) {
        mainLock.runWithWriteLock(() -> {
            // the specified comparator has been set
            if (Objects.equals(this.pluginComparator, comparator)) {
                return;
            }
            this.pluginComparator = comparator;
            forQuickIndexes(QuickIndex::sort);
        });
        return this;
    }
@Test
    public void testSetPluginComparator() {
        Assert.assertFalse(manager.isEnableSort());

        manager.register(new TestExecuteAwarePlugin());
        manager.register(new TestTaskAwarePlugin());
        manager.setPluginComparator(AnnotationAwareOrderComparator.INSTANCE);
        manager.register(new TestRejectedAwarePlugin());
        manager.register(new TestShutdownAwarePlugin());
        Assert.assertTrue(manager.isEnableSort());

        Iterator<ThreadPoolPlugin> iterator = manager.getAllPlugins().iterator();
        Assert.assertEquals(TestTaskAwarePlugin.class, iterator.next().getClass());
        Assert.assertEquals(TestRejectedAwarePlugin.class, iterator.next().getClass());
        Assert.assertEquals(TestExecuteAwarePlugin.class, iterator.next().getClass());
        Assert.assertEquals(TestShutdownAwarePlugin.class, iterator.next().getClass());
    }