void (AssertHint assertHint, final @NonNls String methodName) { final PsiExpression firstArgument = assertHint.getFirstArgument(); PsiExpression lhs = null; PsiExpression rhs = null; if (firstArgument instanceof PsiBinaryExpression binaryExpression) { lhs = binaryExpression.getLOperand(); rhs = binaryExpression.getROperand(); } else { final EqualityCheck check = EqualityCheck.from(firstArgument); if (check != null) { lhs = check.getLeft(); rhs = check.getRight(); } else if (firstArgument instanceof PsiMethodCallExpression && ARRAYS_EQUALS.test((PsiMethodCallExpression)firstArgument)) { final PsiExpression[] args = ((PsiMethodCallExpression)firstArgument).getArgumentList().getExpressions(); lhs = args[0]; rhs = args[1]; } } if (!ExpressionUtils.isEvaluatedAtCompileTime(lhs) && ExpressionUtils.isEvaluatedAtCompileTime(rhs)) { final PsiExpression temp = lhs; lhs = rhs; rhs = temp; } if (lhs == null || rhs == null) { return; } if (!assertHint.isExpectedActualOrder()) { final PsiExpression temp = lhs; lhs = rhs; rhs = temp; } final StringBuilder buf = new StringBuilder(); final PsiType lhsType = lhs.getType(); final PsiType rhsType = rhs.getType(); if (lhsType != null && rhsType != null && PsiUtil.isLanguageLevel5OrHigher(lhs)) { final PsiPrimitiveType rhsUnboxedType = PsiPrimitiveType.getUnboxedType(rhsType); if (isPrimitiveAndBoxedWithOverloads(lhsType, rhsType) && rhsUnboxedType != null) { buf.append(lhs.getText()).append(",(").append(rhsUnboxedType.getCanonicalText()).append(')').append(rhs.getText()); } else { final PsiPrimitiveType unboxedType = PsiPrimitiveType.getUnboxedType(lhsType); if (isPrimitiveAndBoxedWithOverloads(rhsType, lhsType) && unboxedType != null) { buf.append('(').append(unboxedType.getCanonicalText()).append(')').append(lhs.getText()).append(',').append(rhs.getText()); } else { buf.append(lhs.getText()).append(',').append(rhs.getText()); } } } else { buf.append(lhs.getText()).append(',').append(rhs.getText()); } final PsiExpression originalExpression = assertHint.getOriginalExpression(); if (lhsType != null && TypeConversionUtil.isFloatOrDoubleType(lhsType.getDeepComponentType()) || rhsType != null && TypeConversionUtil.isFloatOrDoubleType(rhsType.getDeepComponentType())) { final String noDelta = compoundMethodCall(methodName, assertHint, buf.toString()); final PsiElementFactory factory = JavaPsiFacade.getElementFactory(originalExpression.getProject()); final PsiExpression expression = methodName.equals("assertNotEquals") ? null : factory.createExpressionFromText(noDelta, originalExpression); final PsiMethod method = expression instanceof PsiMethodCallExpression ? ((PsiMethodCallExpression)expression).resolveMethod() : null; if (method == null || method.isDeprecated()) { buf.append(",0.0"); } } final String newExpression = compoundMethodCall(methodName, assertHint, buf.toString()); PsiReplacementUtil.replaceExpressionAndShorten(originalExpression, newExpression); }