public static void setKiePMMLModelConstructor(final String generatedClassName,
                                                  final ConstructorDeclaration constructorDeclaration,
                                                  final String fileName,
                                                  final String name,
                                                  final List<MiningField> miningFields,
                                                  final List<OutputField> outputFields,
                                                  final List<TargetField> targetFields) {
        setKiePMMLConstructorSuperNameInvocation(generatedClassName, constructorDeclaration, fileName, name);
        final BlockStmt body = constructorDeclaration.getBody();
        final List<ObjectCreationExpr> miningFieldsObjectCreations = getMiningFieldsObjectCreations(miningFields);
        addListPopulationByObjectCreationExpr(miningFieldsObjectCreations, body, "miningFields");
        final List<ObjectCreationExpr> outputFieldsObjectCreations = getOutputFieldsObjectCreations(outputFields);
        addListPopulationByObjectCreationExpr(outputFieldsObjectCreations, body, "outputFields");
        final List<MethodCallExpr> kiePMMLTargetFieldsObjectCreations =
                getKiePMMLTargetFieldsObjectCreations(targetFields);
        addListPopulationByMethodCallExpr(kiePMMLTargetFieldsObjectCreations, body, "kiePMMLTargets");
    }
@Test
    void setKiePMMLModelConstructor() {
        String generatedClassName = "generatedClassName";
        String fileName = "fileName";
        String name = "newName";
        List<MiningField> miningFields = IntStream.range(0, 3)
                .mapToObj(i -> ModelUtils.convertToKieMiningField(getRandomMiningField(),
                                                                  getRandomDataField()))
                .collect(Collectors.toList());
        List<OutputField> outputFields = IntStream.range(0, 2)
                .mapToObj(i -> ModelUtils.convertToKieOutputField(getRandomOutputField(),
                                                                  getRandomDataField()))
                .collect(Collectors.toList());
        List<TargetField> targetFields = IntStream.range(0, 2)
                .mapToObj(i -> ModelUtils.convertToKieTargetField(getRandomTarget()))
                .collect(Collectors.toList());
        org.kie.pmml.compiler.commons.codegenfactories.KiePMMLModelFactoryUtils.setKiePMMLModelConstructor(generatedClassName,
                                                                                                           constructorDeclaration,
                                                                                                           fileName,
                                                                                                           name,
                                                                                                           miningFields,
                                                                                                           outputFields,
                                                                                                           targetFields);
        commonVerifySuperInvocation(generatedClassName,  fileName, name);
        List<MethodCallExpr> retrieved = getMethodCallExprList(constructorDeclaration.getBody(), miningFields.size(),
                                                               "miningFields",
                                                               "add");
        MethodCallExpr addMethodCall = retrieved.get(0);
        NodeList<Expression> arguments = addMethodCall.getArguments();
        commonVerifyMiningFieldsObjectCreation(arguments, miningFields);

        retrieved = getMethodCallExprList(constructorDeclaration.getBody(), outputFields.size(), "outputFields",
                                          "add");
        addMethodCall = retrieved.get(0);
        arguments = addMethodCall.getArguments();
        commonVerifyOutputFieldsObjectCreation(arguments, outputFields);

        retrieved = getMethodCallExprList(constructorDeclaration.getBody(), outputFields.size(), "kiePMMLTargets",
                                          "add");
        addMethodCall = retrieved.get(0);
        arguments = addMethodCall.getArguments();
        commonVerifyKiePMMLTargetFieldsMethodCallExpr(arguments, targetFields);
    }