boolean (PsiElement element) { PsiJavaCodeReferenceElement ref = element instanceof PsiNewExpression ? ((PsiNewExpression)element).getClassOrAnonymousClassReference() : null; return ref != null && ref.resolve() != null; }