@Test
public void setCompoundPredicateConstructorOr() {

    init(KIE_PMML_COMPOUND_PREDICATE_TEMPLATE_JAVA, KIE_PMML_COMPOUND_PREDICATE_TEMPLATE);
    String generatedClassName = "GENERATEDCLASSNAME";
    String predicateName = "PREDICATENAME";
    BOOLEAN_OPERATOR booleanOperator = BOOLEAN_OPERATOR.OR;
    Set<String> predicatesClasses = new HashSet<>(Arrays.asList("PREDICATE_A", "PREDICATE_B"));
    KiePMMLPredicateFactory.setCompoundPredicateConstructor(generatedClassName,
                                                            predicateName,
                                                            constructorDeclaration,
                                                            booleanOperator,
                                                            predicatesClasses);
    Map<Integer, Expression> superInvocationExpressionsMap = new HashMap<>();
    superInvocationExpressionsMap.put(0, new NameExpr(String.format("\"%s\"", predicateName)));
    superInvocationExpressionsMap.put(2,
                                      new NameExpr(booleanOperator.getClass().getCanonicalName() + "." + booleanOperator.name()));
    Map<String, Expression> assignExpressionMap = new HashMap<>();
    Expression expression = parseExpression("(aBoolean, aBoolean2) -> aBoolean != null ? aBoolean || aBoolean2 : " +
                                                    "aBoolean2");
    assignExpressionMap.put("operatorFunction", expression);
    ClassOrInterfaceType kiePMMLSegmentClass = parseClassOrInterfaceType(ArrayList.class.getName());
    ObjectCreationExpr objectCreationExpr = new ObjectCreationExpr();
    objectCreationExpr.setType(kiePMMLSegmentClass);
    assignExpressionMap.put("kiePMMLPredicates", objectCreationExpr);
    assertTrue(commonEvaluateConstructor(constructorDeclaration, generatedClassName, superInvocationExpressionsMap,
                              assignExpressionMap));
    List<MethodCallExpr> methodCallExprs = constructorDeclaration.getBody()
            .getStatements().stream().filter(statement -> statement instanceof ExpressionStmt)
            .map(statement -> (ExpressionStmt) statement)
            .filter(expressionStmt -> expressionStmt.getExpression() instanceof MethodCallExpr)
            .map(expressionStmt -> (MethodCallExpr) expressionStmt.getExpression())
            .filter(methodCallExpr -> methodCallExpr.getScope().isPresent() &&
                    methodCallExpr.getScope().get().asNameExpr().getName().asString().equals("kiePMMLPredicates") &&
                    methodCallExpr.getName().asString().equals("add"))
            .collect(Collectors.toList());
    assertNotNull(methodCallExprs);
    assertEquals(predicatesClasses.size(), methodCallExprs.size());
    predicatesClasses.forEach(predicateClass -> {
        ClassOrInterfaceType kiePMMLPredicateClass = parseClassOrInterfaceType(predicateClass);
        ObjectCreationExpr expected = new ObjectCreationExpr();
        expected.setType(kiePMMLPredicateClass);
        assertTrue(methodCallExprs.stream()
                           .anyMatch(methodCallExpr -> methodCallExpr.getArguments().size() == 1 &&
                                   methodCallExpr.getArguments().get(0).equals(expected)));
    });
}