@Contract(pure = true)
  public static @NotNull GlobalSearchScope union(@NotNull Collection<? extends GlobalSearchScope> scopes) {
    if (scopes.isEmpty()) {
      throw new IllegalArgumentException("Empty scope collection");
    }
    if (scopes.size() == 1) {
      return scopes.iterator().next();
    }
    return UnionScope.create(scopes.toArray(EMPTY_ARRAY));
  }
@Contract(pure = true)
  public static @NotNull GlobalSearchScope union(@NotNull Collection<? extends GlobalSearchScope> scopes)