static Expression createIntervalsExpression(List<Interval> intervals) {
        ExpressionStmt arraysAsListStmt = CommonCodegenUtils.createArraysAsListExpression();
        MethodCallExpr arraysCallExpression = arraysAsListStmt.getExpression().asMethodCallExpr();
        NodeList<Expression> arguments = new NodeList<>();
        intervals.forEach(value -> arguments.add(getObjectCreationExprFromInterval(value)));
        arraysCallExpression.setArguments(arguments);
        arraysAsListStmt.setExpression(arraysCallExpression);
        return arraysAsListStmt.getExpression();
    }
@Test
    void createIntervalsExpression() {
        List<Interval> intervals = IntStream.range(0, 3)
                .mapToObj(i -> {
                    int leftMargin = new Random().nextInt(40);
                    int rightMargin = leftMargin + 13;
                    return new Interval(leftMargin, rightMargin);
                })
                .collect(Collectors.toList());
        Expression retrieved =
                org.kie.pmml.compiler.commons.codegenfactories.KiePMMLModelFactoryUtils.createIntervalsExpression(intervals);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved).isInstanceOf(MethodCallExpr.class);
        MethodCallExpr mtdExp = (MethodCallExpr) retrieved;
        String expected = "java.util.Arrays";
        assertThat(mtdExp.getScope().get().asNameExpr().toString()).isEqualTo(expected);
        expected = "asList";
        assertThat(mtdExp.getName().asString()).isEqualTo(expected);
        NodeList<Expression> arguments = mtdExp.getArguments();
        assertThat(arguments).hasSameSizeAs(intervals);
        arguments.forEach(argument -> {
            assertThat(argument).isInstanceOf(ObjectCreationExpr.class);
            ObjectCreationExpr objCrt = (ObjectCreationExpr) argument;
            assertThat(objCrt.getType().asString()).isEqualTo(Interval.class.getCanonicalName());
            Optional<Interval> intervalOpt = intervals.stream()
                    .filter(interval -> String.valueOf(interval.getLeftMargin()).equals(objCrt.getArgument(0).asNameExpr().toString()) &&
                            String.valueOf(interval.getRightMargin()).equals(objCrt.getArgument(1).asNameExpr().toString()))
                    .findFirst();
            assertThat(intervalOpt).isPresent();
        });
    }