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