@Test(expectedExceptions = IllegalArgumentException.class)
public void shouldThrowOnEvaluateInvalidSubExpressions() {

    AlarmExpression expr = new AlarmExpression(
            "avg(hpcs.compute{instance_id=5,metric_name=cpu,device=2}, 1) > 5 times 3 and avg(hpcs.compute{flavor_id=3,metric_name=mem}, 2) < 4 times 3");
    expr.evaluate(ImmutableMap.<AlarmSubExpression, Boolean>builder()
                      .put(
                          new AlarmSubExpression(AggregateFunction.AVG,
                                                 new MetricDefinition("hpcs.compute",
                                                                      ImmutableMap
                                                                          .<String, String>builder()
                                                                          .put("flavor_id", "3")
                                                                          .put("metric_name",
                                                                               "mem")
                                                                          .build()),
                                                 AlarmOperator.LT, 4, 2, 3), true)
                      .build());
}