void (String methodToUse, PsiMethodCallExpression redundantCall) { PsiMethodCallExpression equalsCall = PsiTreeUtil.getParentOfType(redundantCall, PsiMethodCallExpression.class); if (equalsCall == null) return; PsiExpression qualifierBeforeChangeCase = ExpressionUtils.getEffectiveQualifier(redundantCall.getMethodExpression()); if (qualifierBeforeChangeCase == null) return; CommentTracker ct = new CommentTracker(); ct.replaceAndRestoreComments(redundantCall, qualifierBeforeChangeCase); ExpressionUtils.bindCallTo(equalsCall, methodToUse); }