void (@NotNull List<? extends PackageSet> selected) { for (PackageSet set : selected) { if (myCurrentScope == null) { myCurrentScope = set; } else if (myCurrentScope instanceof InvalidPackageSet) { myCurrentScope = StringUtil.isEmpty(myCurrentScope.getText()) ? set : UnionPackageSet.create(myCurrentScope, set); } else { final boolean[] append = {true}; final PackageSet simplifiedScope = processComplementaryScope(myCurrentScope, set, true, append); if (!append[0]) { myCurrentScope = simplifiedScope; } else if (simplifiedScope == null) { myCurrentScope = set; } else { PackageSet[] sets = simplifiedScope instanceof UnionPackageSet ? ((UnionPackageSet)simplifiedScope).getSets() : new PackageSet[]{simplifiedScope}; myCurrentScope = UnionPackageSet.create(ArrayUtil.append(sets, set)); } } } rebuild(true); }