PsiMethod (final PsiClass aClass) { if (!MAIN_CLASS.value(aClass)) return null; PsiMethod method = findMainMethod(aClass); if (method != null && !method.hasModifierProperty(PsiModifier.STATIC) && aClass.isInterface()) return null; return method; }