@Test
public void getAllFieldTypes() {

  IndexMapping indexMapping = new IndexMapping(ImmutableMap.of("name", "text", "age", "int"));
  Map<String, String> fieldTypes = indexMapping.getAllFieldTypes(type -> "our_type");
  assertThat(
      fieldTypes,
      allOf(aMapWithSize(2), hasEntry("name", "our_type"), hasEntry("age", "our_type")));
}