boolean (PsiClass aClass, PsiMethod prototype, PsiElement element) { PsiMethod existingAccessor = aClass.findMethodBySignature(prototype, false); if (existingAccessor != null) { PsiElement parent = element; while (parent != null) { if (existingAccessor.equals(parent)) return true; parent = parent.getParent(); } } return false; }