void (@NotNull PyInspectionVisitor visitor, @NotNull PyBinaryExpression binaryExpression, @NotNull List<PyType> argumentTypes, @NotNull List<PyTypeCheckerInspection.AnalyzeCalleeResults> calleesResults, @NotNull TypeEvalContext context) { final Predicate<PyTypeCheckerInspection.AnalyzeCalleeResults> isRightOperatorResults = calleeResults -> binaryExpression.isRightOperator(calleeResults.getCallable()); final boolean allCalleesAreRightOperators = calleesResults.stream().allMatch(isRightOperatorResults); final List<PyTypeCheckerInspection.AnalyzeCalleeResults> preferredOperatorsResults = allCalleesAreRightOperators ? calleesResults : ContainerUtil.filter(calleesResults, calleeResults -> !isRightOperatorResults.test(calleeResults)); if (preferredOperatorsResults.size() == 1) { registerSingleCalleeProblem(visitor, binaryExpression, preferredOperatorsResults.get(0), context); } else { visitor.registerProblem( allCalleesAreRightOperators ? binaryExpression.getLeftExpression() : binaryExpression.getRightExpression(), getMultiCalleeProblemMessage(argumentTypes, preferredOperatorsResults, context, isOnTheFly(visitor)) ); } }