PsiClass () { PsiJavaCodeReferenceElement classReference = getClassReference(); if (classReference == null) return null; PsiElement result = classReference.resolve(); if (result instanceof PsiClass) { return (PsiClass) result; } else { return null; } }