@Test
public void evaluateSurrogateCompoundPredicate(){

	FieldName temperature = FieldName.create("temperature");
	FieldName humidity = FieldName.create("humidity");
	CompoundPredicate temperaturePredicate = new CompoundPredicate(CompoundPredicate.BooleanOperator.AND, null)
		.addPredicates(
			new SimplePredicate(temperature, SimplePredicate.Operator.LESS_THAN, "90"),
			new SimplePredicate(temperature, SimplePredicate.Operator.GREATER_THAN, "50")
		);
	SimplePredicate humidityPredicate = new SimplePredicate(humidity, SimplePredicate.Operator.GREATER_OR_EQUAL, "80");
	CompoundPredicate compoundPredicate = new CompoundPredicate(CompoundPredicate.BooleanOperator.SURROGATE, null)
		.addPredicates(temperaturePredicate, humidityPredicate);
	assertEquals(Boolean.TRUE, evaluate(compoundPredicate, temperature, 70, humidity, null));
	assertEquals(Boolean.FALSE, evaluate(compoundPredicate, temperature, 40, humidity, null));
	assertEquals(Boolean.FALSE, evaluate(compoundPredicate,  temperature, 100, humidity, null));
	assertEquals(Boolean.TRUE, evaluate(compoundPredicate, temperature, null, humidity, 90));
	assertEquals(Boolean.FALSE, evaluate(compoundPredicate, temperature, null, humidity, 70));
	assertEquals(null, evaluate(compoundPredicate, temperature, null, humidity, null));
}