@Test
public void addOutputFieldsPopulation() {

    BlockStmt blockStmt = new BlockStmt();
    List<KiePMMLOutputField> outputFields = IntStream.range(0, 3)
            .mapToObj(index -> KiePMMLOutputField.builder("OUTPUTFIELD-" + index, Collections.emptyList())
                    .withRank(new Random().nextInt(3))
                    .withValue("VALUE-" + index)
                    .withTargetField("TARGETFIELD-" + index)
                    .build())
            .collect(Collectors.toList());
    KiePMMLModelFactoryUtils.addOutputFieldsPopulation(blockStmt, outputFields);
    List<MethodCallExpr> retrieved = getMethodCallExprList(blockStmt, outputFields.size(), "outputFields", "add");
    for (KiePMMLOutputField outputField : outputFields) {
        assertTrue(retrieved.stream()
                           .filter(methodCallExpr -> methodCallExpr.getArguments().size() == 1)
                           .map(methodCallExpr -> methodCallExpr.getArgument(0))
                           .filter(Expression::isMethodCallExpr)
                           .map(expressionArgument -> (MethodCallExpr) expressionArgument)
                           .anyMatch(methodCallExpr -> evaluateOutputFieldPopulation(methodCallExpr, outputField)));
    }
}