PsiJavaCodeReferenceElement () { ASTNode ref = findChildByType(CLASS_REF); if (ref == null) return null; if (ref instanceof PsiJavaCodeReferenceElement) return (PsiJavaCodeReferenceElement)ref; PsiAnonymousClass anonymousClass = (PsiAnonymousClass)ref.getPsi(); return anonymousClass.getBaseClassReference(); }