boolean (PsiReference ref1, PsiReference ref2) { PsiElement resolved1 = ref1.resolve(); PsiElement resolved2 = ref2.resolve(); return Comparing.equal(resolved1, resolved2) || myResolvedElementsComparator != null && myResolvedElementsComparator.test(resolved1, resolved2); }