@Override
    @SuppressWarnings("unchecked")
    public <A extends ThreadPoolPlugin> Optional<A> getPlugin(String pluginId) {
        return mainLock.applyWithReadLock(
                () -> (Optional<A>) Optional.ofNullable(registeredPlugins.get(pluginId)));
    }
@Test
    public void testGetPlugin() {
        ThreadPoolPlugin plugin = new TestExecuteAwarePlugin();
        manager.register(plugin);
        Assert.assertSame(plugin, manager.getPlugin(plugin.getId()).orElse(null));
    }