void (AssertHint assertHint) { final PsiBinaryExpression firstArgument = (PsiBinaryExpression)assertHint.getFirstArgument(); PsiExpression lhs = firstArgument.getLOperand(); PsiExpression rhs = firstArgument.getROperand(); final IElementType tokenType = firstArgument.getOperationTokenType(); if (!ExpressionUtils.isEvaluatedAtCompileTime(lhs) && ExpressionUtils.isEvaluatedAtCompileTime(rhs)) { final PsiExpression temp = lhs; lhs = rhs; rhs = temp; } if (rhs == null) { return; } @NonNls final String methodName = assertHint.getMethod().getName(); @NonNls final String memberName; if ("assertFalse".equals(methodName) ^ tokenType.equals(JavaTokenType.NE)) { memberName = "assertNotSame"; } else { memberName = "assertSame"; } final String newExpression = compoundMethodCall(memberName, assertHint, lhs.getText() + "," + rhs.getText()); PsiReplacementUtil.replaceExpressionAndShorten(assertHint.getOriginalExpression(), newExpression); }