@ApiStatus.Internal
  @Nullable
  static PackageSet doIncludeSelected(@NotNull PackageSet set, @Nullable PackageSet current) {
    if (current == null) {
      current = set;
    }
    else if (current instanceof InvalidPackageSet) {
      current = StringUtil.isEmpty(current.getText()) ? set : UnionPackageSet.create(current, set);
    }
    else {
      final boolean[] append = {true};
      final PackageSet simplifiedScope = processComplementaryScope(current, set, true, append);
      if (!append[0]) {
        current = simplifiedScope;
      }
      else if (simplifiedScope == null) {
        current = set;
      }
      else {
        PackageSet[] sets = simplifiedScope instanceof UnionPackageSet ?
                            ((UnionPackageSet)simplifiedScope).getSets() :
                            new PackageSet[]{simplifiedScope};
        current = UnionPackageSet.create(ArrayUtil.append(sets, set));
      }
    }
    return current;
  }
@ApiStatus.Internal
  @Nullable
  static PackageSet doIncludeSelected(@NotNull PackageSet set, @Nullable PackageSet current)