boolean (PsiElement element, PsiClass psiClass) { final PsiReferenceList extendsList = psiClass.getExtendsList(); final PsiReferenceList implementsList = psiClass.getImplementsList(); if (extendsList != null && PsiTreeUtil.isAncestor(extendsList, element, false)) { return true; } return implementsList != null && PsiTreeUtil.isAncestor(implementsList, element, false); }