public static boolean hasMainMethod(final PsiClass psiClass) {
    JavaMainMethodProvider mainMethodProvider = getApplicableMainMethodProvider(psiClass);
    if (mainMethodProvider != null) {
      return mainMethodProvider.hasMainMethod(psiClass);
    }

    DumbService dumbService = DumbService.getInstance(psiClass.getProject());
    try {
      return dumbService.computeWithAlternativeResolveEnabled((ThrowableComputable<Boolean, Throwable>)() -> {
        final PsiMethod[] mainMethods = psiClass.findMethodsByName("main", true);
        return findMainMethod(mainMethods, psiClass, true) != null;
      });
    }
    catch (IndexNotReadyException e) {
      return false;
    }
  }
public static boolean hasMainMethod(final PsiClass psiClass)