boolean (PsiExpression expression, PsiExpression replacement) { PsiElement parent = expression.getParent(); while (parent instanceof PsiParenthesizedExpression) { expression = (PsiExpression)parent; parent = parent.getParent(); } if (!(parent instanceof PsiExpressionList)) { return false; } final PsiElement grandParent = parent.getParent(); if (!(grandParent instanceof PsiCall call)) { return false; } return call.resolveMethod() != findMethodWithReplacedArgument(call, expression, replacement); }