@Test
void should_build_type_mapping_for_field_reference() {

  assertThat(
      buildTypeMapping(Arrays.asList(
          named("avg(age)", new AvgAggregator(Arrays.asList(ref("age", INTEGER)), INTEGER))),
          Arrays.asList(named("name", ref("name", STRING)))),
      containsInAnyOrder(
          map("avg(age)", INTEGER),
          map("name", STRING)
      ));
}