@Override
    public boolean isPluginLoaded(String pluginId) {
        final GoPluginDescriptor descriptor = getPluginDescriptorFor(pluginId);
        return !(descriptor == null || descriptor.isInvalid());
    }
@Test
    void isPluginLoaded_shouldReturnFalseWhenPluginIsLoadedButIsInInvalidState() {
        final GoPluginDescriptor dockerPluginDescriptor = mock(GoPluginDescriptor.class);

        when(dockerPluginDescriptor.isInvalid()).thenReturn(true);
        when(registry.getPlugin("cd.go.elastic-agent.docker")).thenReturn(dockerPluginDescriptor);

        DefaultPluginManager pluginManager = new DefaultPluginManager(monitor, registry, mock(GoPluginOSGiFramework.class), jarChangeListener, pluginRequestProcessorRegistry, systemEnvironment, pluginLoader);

        assertThat(pluginManager.isPluginLoaded("cd.go.elastic-agent.docker")).isFalse();
    }