static void populateEvaluateNodeWithScoreDistributions(final BlockStmt toPopulate,
                                                           final List<ScoreDistribution> scoreDistributionsParam) {
        final Expression scoreDistributionsExpression;
        if (scoreDistributionsParam == null) {
            scoreDistributionsExpression = new NullLiteralExpr();
        } else {
            int counter = 0;
            final NodeList<Expression> scoreDistributionsArguments = new NodeList<>();
            for (ScoreDistribution scoreDistribution : scoreDistributionsParam) {
                String nestedVariableName = String.format("scoreDistribution_%s", counter);
                scoreDistributionsArguments.add(getKiePMMLScoreDistribution(nestedVariableName, scoreDistribution));
                counter ++;
            }
            scoreDistributionsExpression = new MethodCallExpr();
            ((MethodCallExpr)scoreDistributionsExpression).setScope(new NameExpr(Arrays.class.getSimpleName()));
            ((MethodCallExpr)scoreDistributionsExpression).setName("asList");
            ((MethodCallExpr)scoreDistributionsExpression).setArguments(scoreDistributionsArguments);
        }
        CommonCodegenUtils.setVariableDeclaratorValue(toPopulate, SCORE_DISTRIBUTIONS, scoreDistributionsExpression);
    }
@Test
    void populateEvaluateNodeWithScoreDistributions() {
        final BlockStmt toPopulate = new BlockStmt();
        final VariableDeclarator variableDeclarator = new VariableDeclarator();
        variableDeclarator.setType("List");
        variableDeclarator.setName(SCORE_DISTRIBUTIONS);
        toPopulate.addStatement(new VariableDeclarationExpr(variableDeclarator));
        assertThat(variableDeclarator.getInitializer()).isNotPresent();
        // Without probability
        List<ScoreDistribution> scoreDistributions = getRandomPMMLScoreDistributions(false);
        KiePMMLNodeFactory.populateEvaluateNodeWithScoreDistributions(toPopulate, scoreDistributions);
        commonVerifyEvaluateNodeWithScoreDistributions(variableDeclarator, scoreDistributions);
        // With probability
        scoreDistributions = getRandomPMMLScoreDistributions(true);
        KiePMMLNodeFactory.populateEvaluateNodeWithScoreDistributions(toPopulate, scoreDistributions);
        commonVerifyEvaluateNodeWithScoreDistributions(variableDeclarator, scoreDistributions);
    }