static ObjectCreationExpr getObjectCreationExprFromInterval(Interval source) {
        ObjectCreationExpr toReturn = new ObjectCreationExpr();
        toReturn.setType(Interval.class.getCanonicalName());
        NodeList<Expression> arguments = new NodeList<>();
        if (source.getLeftMargin() != null) {
            arguments.add(new NameExpr(source.getLeftMargin().toString()));
        } else {
            arguments.add(new NullLiteralExpr());
        }
        if (source.getRightMargin() != null) {
            arguments.add(new NameExpr(source.getRightMargin().toString()));
        } else {
            arguments.add(new NullLiteralExpr());
        }
        toReturn.setArguments(arguments);
        return toReturn;
    }
@Test
    void getObjectCreationExprFromInterval() {
        Interval interval = new Interval(null, -14);
        ObjectCreationExpr retrieved =
                org.kie.pmml.compiler.commons.codegenfactories.KiePMMLModelFactoryUtils.getObjectCreationExprFromInterval(interval);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved.getType().asString()).isEqualTo(Interval.class.getCanonicalName());
        NodeList<Expression> arguments = retrieved.getArguments();
        assertThat(arguments).hasSize(2);
        assertThat(arguments.get(0)).isInstanceOf(NullLiteralExpr.class);
        assertThat(arguments.get(1).asNameExpr().toString()).isEqualTo(String.valueOf(interval.getRightMargin()));
        interval = new Interval(-13, 10);
        retrieved =
                org.kie.pmml.compiler.commons.codegenfactories.KiePMMLModelFactoryUtils.getObjectCreationExprFromInterval(interval);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved.getType().asString()).isEqualTo(Interval.class.getCanonicalName());
        arguments = retrieved.getArguments();
        assertThat(arguments).hasSize(2);
        assertThat(arguments.get(0).asNameExpr().toString()).isEqualTo(String.valueOf(interval.getLeftMargin()));
        assertThat(arguments.get(1).asNameExpr().toString()).isEqualTo(String.valueOf(interval.getRightMargin()));
        interval = new Interval(-13, null);
        retrieved =
                org.kie.pmml.compiler.commons.codegenfactories.KiePMMLModelFactoryUtils.getObjectCreationExprFromInterval(interval);
        assertThat(retrieved).isNotNull();
        assertThat(retrieved.getType().asString()).isEqualTo(Interval.class.getCanonicalName());
        arguments = retrieved.getArguments();
        assertThat(arguments).hasSize(2);
        assertThat(arguments.get(0).asNameExpr().toString()).isEqualTo(String.valueOf(interval.getLeftMargin()));
        assertThat(arguments.get(1)).isInstanceOf(NullLiteralExpr.class);
    }