static void commonPopulateGetCreatedKiePMMLMiningFieldsMethod(final MethodDeclaration methodDeclaration,
                                                                  final List<org.dmg.pmml.MiningField> miningFields,
                                                                  final List<org.dmg.pmml.Field<?>> fields) {
        BlockStmt body = new BlockStmt();
        NodeList<Expression> arguments = new NodeList<>();
        for (org.dmg.pmml.MiningField miningField : miningFields) {
            String miningFieldVariableName = getSanitizedVariableName(miningField.getName()).toLowerCase();
            BlockStmt toAdd = getMiningFieldVariableDeclaration(miningFieldVariableName, miningField, fields);
            toAdd.getStatements().forEach(body::addStatement);
            arguments.add(new NameExpr(miningFieldVariableName));
        }
        MethodCallExpr methodCallExpr = new MethodCallExpr();
        methodCallExpr.setScope(new NameExpr(Arrays.class.getSimpleName()));
        methodCallExpr.setName("asList");
        methodCallExpr.setArguments(arguments);
        ReturnStmt returnStmt = new ReturnStmt();
        returnStmt.setExpression(methodCallExpr);
        body.addStatement(returnStmt);
        methodDeclaration.setBody(body);
    }
@Test
    void commonPopulateGetCreatedKiePMMLMiningFieldsMethod() throws IOException {
        final CompilationDTO compilationDTO = CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME,
                                                                                                     pmmlModel,
                                                                                                     model,
                                                                                                     new PMMLCompilationContextMock(), SOURCE_BASE);
        final MethodDeclaration methodDeclaration = new MethodDeclaration();
        org.kie.pmml.compiler.commons.codegenfactories.KiePMMLModelFactoryUtils.commonPopulateGetCreatedKiePMMLMiningFieldsMethod(methodDeclaration,
                                                                                                                                  compilationDTO.getMiningSchema().getMiningFields(), compilationDTO.getFields());
        String text = getFileContent(TEST_06_SOURCE);
        MethodDeclaration expected = JavaParserUtils.parseMethod(text);
        assertThat(JavaParserUtils.equalsNode(expected, methodDeclaration)).isTrue();
    }