@Test
public void setConstructor() {

    ConstructorDeclaration constructorDeclaration = MODEL_TEMPLATE.getDefaultConstructor().get();
    String segmentName = "SEGMENTNAME";
    String generatedClassName = "GENERATEDCLASSNAME";
    String predicateClassName = "PREDICATECLASSNAME";
    String kiePMMLModelClass = "KIEPMMLMODELCLASS";
    double weight = 12.22;
    KiePMMLSegmentFactory.setConstructor(segmentName,
                                         generatedClassName,
                                         constructorDeclaration,
                                         predicateClassName,
                                         kiePMMLModelClass,
                                         weight);
    Map<Integer, Expression> superInvocationExpressionsMap = new HashMap<>();
    superInvocationExpressionsMap.put(0, new NameExpr(String.format("\"%s\"", segmentName)));
    ClassOrInterfaceType classOrInterfaceType = parseClassOrInterfaceType(predicateClassName);
    ObjectCreationExpr objectCreationExpr = new ObjectCreationExpr();
    objectCreationExpr.setType(classOrInterfaceType);
    superInvocationExpressionsMap.put(2, new NameExpr(objectCreationExpr.toString()));
    classOrInterfaceType = parseClassOrInterfaceType(kiePMMLModelClass);
    objectCreationExpr = new ObjectCreationExpr();
    objectCreationExpr.setType(classOrInterfaceType);
    superInvocationExpressionsMap.put(3, new NameExpr(objectCreationExpr.toString()));
    Map<String, Expression> assignExpressionMap = new HashMap<>();
    assignExpressionMap.put("weight", new DoubleLiteralExpr(weight));
    assignExpressionMap.put("id", new StringLiteralExpr(segmentName));
    assertTrue(commonEvaluateConstructor(constructorDeclaration, generatedClassName,
                                         superInvocationExpressionsMap, assignExpressionMap));
}