boolean (PsiReference reference) { ProgressManager.checkCanceled(); final PsiElement element = reference.getElement(); final PsiClass usageClass = ClassUtils.getContainingClass(element); if (usageClass == null) { return true; } if (foundClass.compareAndSet(null, usageClass)) { return true; } final PsiClass aClass = foundClass.get(); final PsiManager manager = usageClass.getManager(); return manager.areElementsEquivalent(aClass, usageClass); }