Collection<PluginNode> (@NotNull List<PluginNode> marketplacePlugins, @NotNull List<PluginNode> customPlugins, boolean addMissing) { Map<PluginId, PluginNode> compatiblePluginMap = new LinkedHashMap<>(marketplacePlugins.size()); for (PluginNode marketplacePlugin : marketplacePlugins) { compatiblePluginMap.put(marketplacePlugin.getPluginId(), marketplacePlugin); } for (PluginNode customPlugin : customPlugins) { PluginId pluginId = customPlugin.getPluginId(); IdeaPluginDescriptor plugin = compatiblePluginMap.get(pluginId); if (plugin == null && addMissing || plugin != null && PluginDownloader.compareVersionsSkipBrokenAndIncompatible(customPlugin.getVersion(), plugin) > 0) { compatiblePluginMap.put(pluginId, customPlugin); } } return compatiblePluginMap.values(); }