void (@NotNull PsiJavaCodeReferenceElement reference) { final PsiElement parent = reference.getParent(); if (!(parent instanceof PsiReferenceList)) return; final PsiElement grandParent = parent.getParent(); if (!(grandParent instanceof PsiClass)) return; if (reference.isReferenceTo(aClass)) { subclasses.add((PsiClass)grandParent); } }