@Override
    public boolean evaluate(Map<String, Object> values) {
        Boolean toReturn = null;
        for (KiePMMLPredicate kiePMMLPredicate : kiePMMLPredicates) {
            Boolean evaluation = kiePMMLPredicate.evaluate(values);
            switch (booleanOperator) {
                case OR:
                    toReturn = orOperator(toReturn, evaluation);
                    break;
                case AND:
                    toReturn = andOperator(toReturn, evaluation);
                    break;
                case XOR:
                    toReturn = xorOperator(toReturn, evaluation);
                    break;
                case SURROGATE:
                    toReturn = surrogateOperator(toReturn, evaluation);
                    break;
                default:
                    throw new KiePMMLException("Unknown BOOLEAN_OPERATOR " + booleanOperator);
            }
        }
        return toReturn != null && toReturn;
    }
@Test
    void evaluateCompoundPredicateSurrogate() {
        ARRAY_TYPE arrayType = ARRAY_TYPE.STRING;
        List<Object> stringValues = getObjects(arrayType, 4);
        KiePMMLSimpleSetPredicate kiePMMLSimpleSetPredicateString = getKiePMMLSimpleSetPredicate(SIMPLE_SET_PREDICATE_STRING_NAME,
                                                                                                 stringValues,
                                                                                                 arrayType,
                                                                                                 IN_NOTIN.IN);
        arrayType = ARRAY_TYPE.INT;
        List<Object> intValues = getObjects(arrayType, 4);
        KiePMMLSimpleSetPredicate kiePMMLSimpleSetPredicateInt =
                getKiePMMLSimpleSetPredicate(SIMPLE_SET_PREDICATE_INT_NAME,
                                                                                              intValues,
                                                                                              arrayType,
                                                                                              IN_NOTIN.NOT_IN);
        KiePMMLCompoundPredicate kiePMMLCompoundPredicate = getKiePMMLCompoundPredicate(BOOLEAN_OPERATOR.SURROGATE,
                                                                                        Arrays.asList(kiePMMLSimpleSetPredicateString, kiePMMLSimpleSetPredicateInt));
        Map<String, Object> inputData = new HashMap<>();
        inputData.put(SIMPLE_SET_PREDICATE_STRING_NAME, "NOT"); // This predicate verify the "IN" condition
        inputData.put(SIMPLE_SET_PREDICATE_INT_NAME, intValues.get(0)); // This predicate verify the "NOT_IN" condition
        assertThat(kiePMMLCompoundPredicate.evaluate(inputData)).isFalse();

        inputData.put(SIMPLE_SET_PREDICATE_STRING_NAME, stringValues.get(0)); // This predicate verify the "IN" condition
        inputData.put(SIMPLE_SET_PREDICATE_INT_NAME, intValues.get(0)); // This predicate verify the "NOT_IN" condition
        assertThat(kiePMMLCompoundPredicate.evaluate(inputData)).isTrue();

        inputData.put(SIMPLE_SET_PREDICATE_STRING_NAME, "NOT"); // This predicate verify the "IN" condition
        inputData.put(SIMPLE_SET_PREDICATE_INT_NAME, 1); // This predicate verify the "NOT_IN" condition
        assertThat(kiePMMLCompoundPredicate.evaluate(inputData)).isFalse();

        inputData.put(SIMPLE_SET_PREDICATE_STRING_NAME, stringValues.get(0)); // This predicate verify the "IN"
        // condition
        inputData.put(SIMPLE_SET_PREDICATE_INT_NAME, 1); // This predicate verify the "NOT_IN" condition
        assertThat(kiePMMLCompoundPredicate.evaluate(inputData)).isTrue();
    }