GlobalSearchScope (GlobalSearchScope @NotNull [] scopes) { if (scopes.length == 0) { throw new IllegalArgumentException("Empty scope array"); } if (scopes.length == 1) { return scopes[0]; } return UnionScope.create(scopes); }