Match (@NotNull PsiJavaCodeReferenceElement classReference1, @NotNull PsiJavaCodeReferenceElement classReference2) { final PsiType[] parameters1 = classReference1.getTypeParameters(); final PsiType[] parameters2 = classReference2.getTypeParameters(); if (parameters1.length != parameters2.length) { return EXACT_MISMATCH; } for (int i = 0; i < parameters1.length; i++) { if (!typesAreEquivalent(parameters1[i], parameters2[i])) { return EXACT_MISMATCH; } } final PsiElement target1 = classReference1.resolve(); final PsiElement target2 = classReference2.resolve(); return (target1 == null && target2 == null) ? Match.exact(classReference1.getText().equals(classReference2.getText())) : Match.exact(target1 == target2); }