PropertyDeclaration min = simple.findPropertyDeclaration("min");
assertThat(min, not(nullValue()));
assertThat(min.getType(), is(type(BasicTypeKind.DATE)));
SummarizeTrait trait = simple.getTrait(SummarizeTrait.class);
assertThat(trait, not(nullValue()));
assertThat(trait.getTerms().size(), is(1));
ReduceTerm<AstSummarize> aTerm = trait.getTerms().get(0);
assertThat(aTerm.getSource(), is(model("a")));
assertThat(aTerm.getGrouping(), has(property("key")));
assertThat(aTerm.getMappings(), has(mapping(PropertyMappingKind.ANY, "value_a", "key")));
assertThat(aTerm.getMappings(), has(mapping(PropertyMappingKind.SUM, "value_b", "sum")));
assertThat(aTerm.getMappings(), has(mapping(PropertyMappingKind.COUNT, "value_a", "count")));