boolean (@NotNull PsiElement e1, @NotNull PsiElement e2, @NotNull PsiManager manager) { if (e1 instanceof PsiLiteralExpression && e2 instanceof PsiLiteralExpression) { return Comparing.equal(((PsiLiteralExpression)e1).getValue(), ((PsiLiteralExpression)e2).getValue()); } if (e1 instanceof PsiPrefixExpression && e2 instanceof PsiPrefixExpression && ((PsiPrefixExpression)e1).getOperationTokenType() == ((PsiPrefixExpression)e2).getOperationTokenType()) { PsiExpression lOperand = ((PsiPrefixExpression)e1).getOperand(); PsiExpression rOperand = ((PsiPrefixExpression)e2).getOperand(); return lOperand != null && rOperand != null && same(lOperand, rOperand, manager); } if (e1 instanceof PsiReference && e2 instanceof PsiReference) { e1 = ((PsiReference)e1).resolve(); e2 = ((PsiReference)e2).resolve(); } return manager.areElementsEquivalent(e2, e1); }