public GoPluginBundleDescriptor unloadPlugin(GoPluginBundleDescriptor bundleDescriptor) {
        final GoPluginDescriptor firstPluginDescriptor = bundleDescriptor.descriptors().get(0);
        final GoPluginDescriptor pluginInBundle = getPluginByIdOrFileName(firstPluginDescriptor.id(), firstPluginDescriptor.fileName());

        if (pluginInBundle == null) {
            throw new RuntimeException("Could not find existing plugin with ID: " + firstPluginDescriptor.id());
        }

        final GoPluginBundleDescriptor bundleToRemove = pluginInBundle.bundleDescriptor();
        for (GoPluginDescriptor pluginDescriptor : bundleToRemove.descriptors()) {
            if (getPluginByIdOrFileName(pluginDescriptor.id(), pluginDescriptor.fileName()) == null) {
                throw new RuntimeException("Could not find existing plugin with ID: " + pluginDescriptor.id());
            }
        }

        for (GoPluginDescriptor pluginDescriptor : bundleToRemove.descriptors()) {
            idToDescriptorMap.remove(pluginDescriptor.id().toLowerCase());
        }

        return bundleToRemove;
    }
@Test
    void shouldNotUnloadAPluginIfItWasNotLoadedBefore() {
        assertThatCode(() -> registry.unloadPlugin(new GoPluginBundleDescriptor(GoPluginDescriptor.builder().id("id1").isBundledPlugin(true).build())))
                .isInstanceOf(RuntimeException.class);
    }