public static void addGetCreatedKiePMMLMiningFieldsMethod(final ClassOrInterfaceDeclaration modelTemplate,
                                                              final List<org.dmg.pmml.MiningField> miningFields,
                                                              final List<org.dmg.pmml.Field<?>> fields) {
        final MethodDeclaration methodDeclaration = modelTemplate.addMethod(GET_CREATED_KIEPMMLMININGFIELDS,
                                                                            Modifier.Keyword.PRIVATE);
        final ClassOrInterfaceType returnedType =
                getTypedClassOrInterfaceTypeByTypeNames(List.class.getSimpleName(),
                                                        Collections.singletonList(KiePMMLMiningField.class.getSimpleName()));
        methodDeclaration.setType(returnedType);
        commonPopulateGetCreatedKiePMMLMiningFieldsMethod(methodDeclaration, miningFields, fields);
    }
@Test
    void addGetCreatedKiePMMLMiningFieldsMethod() throws IOException {
        final CompilationDTO compilationDTO = CommonCompilationDTO.fromGeneratedPackageNameAndFields(PACKAGE_NAME,
                                                                                                     pmmlModel,
                                                                                                     model,
                                                                                                     new PMMLCompilationContextMock(), SOURCE_BASE);
        ClassOrInterfaceDeclaration modelTemplate = new ClassOrInterfaceDeclaration();
        org.kie.pmml.compiler.commons.codegenfactories.KiePMMLModelFactoryUtils.addGetCreatedKiePMMLMiningFieldsMethod(modelTemplate,
                                                                                                                       compilationDTO.getMiningSchema().getMiningFields(), compilationDTO.getFields());
        final MethodDeclaration retrieved = modelTemplate.getMethodsByName(GET_CREATED_KIEPMMLMININGFIELDS).get(0);
        String text = getFileContent(TEST_12_SOURCE);
        BlockStmt expected = JavaParserUtils.parseBlock(text);
        assertThat(JavaParserUtils.equalsNode(expected, retrieved.getBody().get())).isTrue();
    }