@Override
    public void unregister(String pluginId) {
        mainLock.runWithWriteLock(
                () -> Optional.ofNullable(pluginId)
                        .map(registeredPlugins::remove)
                        .ifPresent(plugin -> {
                            disabledPlugins.remove(pluginId);
                            forQuickIndexes(quickIndex -> quickIndex.removeIfPossible(plugin));
                            plugin.stop();
                        }));
    }
@Test
    public void testUnregister() {
        manager.register(new TestTaskAwarePlugin());
        manager.unregister(TestTaskAwarePlugin.class.getSimpleName());
        Assert.assertFalse(manager.isRegistered(TestTaskAwarePlugin.class.getSimpleName()));

        manager.register(new TestRejectedAwarePlugin());
        manager.unregister(TestRejectedAwarePlugin.class.getSimpleName());
        Assert.assertFalse(manager.isRegistered(TestRejectedAwarePlugin.class.getSimpleName()));

        manager.register(new TestShutdownAwarePlugin());
        manager.unregister(TestShutdownAwarePlugin.class.getSimpleName());
        Assert.assertFalse(manager.isRegistered(TestShutdownAwarePlugin.class.getSimpleName()));

        manager.register(new TestExecuteAwarePlugin());
        manager.unregister(TestExecuteAwarePlugin.class.getSimpleName());
        Assert.assertFalse(manager.isRegistered(TestExecuteAwarePlugin.class.getSimpleName()));
    }