@Override
    public String resolveExtensionVersion(String pluginId, String extensionType, final List<String> goSupportedExtensionVersions) {
        List<String> pluginSupportedVersions = getRequiredExtensionVersionsByPlugin(pluginId, extensionType);
        String resolvedExtensionVersion = "0";
        for (String pluginSupportedVersion : pluginSupportedVersions) {
            if (goSupportedExtensionVersions.contains(pluginSupportedVersion) && parseDouble(resolvedExtensionVersion) < parseDouble(pluginSupportedVersion)) {
                resolvedExtensionVersion = pluginSupportedVersion;
            }
        }

        if ("0".equals(resolvedExtensionVersion)) {
            throw new RuntimeException(String.format("Could not find matching extension version between Plugin[%s] and Go", pluginId));
        }

        return resolvedExtensionVersion;
    }
@Test
    void shouldThrowExceptionIfMatchingExtensionVersionNotFound() {
        String pluginId = "plugin-id";
        String extensionType = "sample-extension";
        GoPlugin goPlugin = mock(GoPlugin.class);
        GoPlugginOSGiFrameworkStub osGiFrameworkStub = new GoPlugginOSGiFrameworkStub(goPlugin);
        osGiFrameworkStub.addHasReferenceFor(GoPlugin.class, pluginId, extensionType, true);
        when(goPlugin.pluginIdentifier()).thenReturn(new GoPluginIdentifier(extensionType, List.of("1.0", "2.0")));

        DefaultPluginManager pluginManager = new DefaultPluginManager(monitor, registry, osGiFrameworkStub, jarChangeListener, pluginRequestProcessorRegistry, systemEnvironment, pluginLoader);
        try {
            pluginManager.resolveExtensionVersion(pluginId, extensionType, List.of("3.0", "4.0"));
            fail("should have thrown exception for not finding matching extension version");
        } catch (Exception e) {
            assertThat(e.getMessage()).isEqualTo("Could not find matching extension version between Plugin[plugin-id] and Go");
        }
    }