GrReferenceExpression (@NotNull PsiClass aClass) { final String text; if (aClass instanceof PsiAnonymousClass) { text = ((PsiAnonymousClass)aClass).getBaseClassType().getPresentableText(); } else { text = aClass.getName(); } return createReferenceExpressionFromText(text); }