boolean (String referenceText, @NotNull PsiClass target, PsiElement context) { final PsiJavaCodeReferenceElement reference = JavaPsiFacade.getElementFactory(target.getProject()).createReferenceFromText(referenceText, context); final JavaResolveResult[] results = reference.multiResolve(false); if (results.length == 0) { return true; } if (results.length > 1) { return false; } final JavaResolveResult result = results[0]; return result.isAccessible() && target.isEquivalentTo(result.getElement()); }