PsiMethod (String name, @Nullable PsiClass cls) { if (cls == null) return null; for (PsiMethod method : cls.findMethodsByName(name, false)) { if (method.getParameterList().isEmpty()) { return method.getModifierList().hasModifierProperty(PsiModifier.ABSTRACT) ? null : method; } } return findNearestMethod(name, cls.getSuperClass()); }