List<Configurable> (@NotNull Set<Configurable> configurables, @NotNull Set<String> configurableIds) { return ContainerUtil.filter(configurables, configurable -> { if (configurable instanceof SearchableConfigurable && configurableIds.contains(((SearchableConfigurable)configurable).getId())) { return true; } if (configurable instanceof SearchableConfigurable.Merged) { final List<Configurable> mergedConfigurables = ((SearchableConfigurable.Merged)configurable).getMergedConfigurables(); for (Configurable mergedConfigurable : mergedConfigurables) { if (mergedConfigurable instanceof SearchableConfigurable && configurableIds.contains(((SearchableConfigurable)mergedConfigurable).getId())) { return true; } } } return false; }); }