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