private static boolean isAppMain(PsiMethod psiMethod, RefMethod refMethod) {
    if ("main".equals(psiMethod.getName()) && PsiMethodUtil.isMainMethod(psiMethod)) return true;

    if (!refMethod.isStatic()) return false;
    if (!PsiTypes.voidType().equals(psiMethod.getReturnType())) return false;

    if ("main".equals(psiMethod.getName()) && psiMethod.getParameterList().isEmpty() &&
        psiMethod.getLanguage().isKindOf("kotlin")) return true;

    PsiMethod appPremainPattern = ((RefMethodImpl)refMethod).getRefJavaManager().getAppPremainPattern();
    if (MethodSignatureUtil.areSignaturesEqual(psiMethod, appPremainPattern)) return true;

    PsiMethod appAgentmainPattern = ((RefMethodImpl)refMethod).getRefJavaManager().getAppAgentmainPattern();
    return MethodSignatureUtil.areSignaturesEqual(psiMethod, appAgentmainPattern);
  }
private static boolean isAppMain(PsiMethod psiMethod, RefMethod refMethod)