@Nullable
  public static PsiClass findClass(@NotNull String className,
                                   @NotNull Project project,
                                   @NotNull GlobalSearchScope scope,
                                   boolean fallbackToAllScope) {
    ApplicationManager.getApplication().assertReadAccessAllowed();
    try {
      if (getArrayClass(className) != null) {
        return getInstance().createArrayClass(project, LanguageLevelProjectExtension.getInstance(project).getLanguageLevel());
      }
      if (project.isDefault()) {
        return null;
      }

      // remove generics if any
      className = StringUtil.notNullize(StringUtil.substringBefore(className, "<"), className);

      PsiManager psiManager = PsiManager.getInstance(project);
      PsiClass psiClass = ClassUtil.findPsiClass(psiManager, className, null, true, scope);
      if (psiClass == null && fallbackToAllScope) {
        GlobalSearchScope globalScope = getInstance().getFallbackAllScope(scope, project);
        if (globalScope != null) {
          psiClass = ClassUtil.findPsiClass(psiManager, className, null, true, globalScope);
        }
      }

      return psiClass;
    }
    catch (IndexNotReadyException ignored) {
      return null;
    }
  }
@Nullable
  public static PsiClass findClass(@NotNull String className,
                                   @NotNull Project project,
                                   @NotNull GlobalSearchScope scope,
                                   boolean fallbackToAllScope)