public Map<String, String> getTypes(final Set<String> streamIds,
                                        final Set<String> fields) {
        final Map<String, Set<String>> allFieldTypes = this.get(streamIds);

        final Map<String, String> result = new HashMap<>(fields.size());
        fields.forEach(field -> {
            final Set<String> fieldTypes = allFieldTypes.get(field);
            typeFromFieldType(fieldTypes).ifPresent(s -> result.put(field, s));
        });

        return result;
    }
@Test
    void getTypesBehavesCorrectlyIfMultipleScenariosAreMixed() {
        final Pair<IndexFieldTypesService, StreamService> services = mockServices(
                IndexFieldTypesDTO.create("indexSet1", "stream1", Set.of(
                        FieldTypeDTO.create("good_field", "long"),
                        FieldTypeDTO.create("bad_field", "ip")
                )),
                IndexFieldTypesDTO.create("indexSet2", "stream2", Set.of(
                        FieldTypeDTO.create("good_field", "long"),
                        FieldTypeDTO.create("bad_field", "text")
                ))
        );

        final FieldTypesLookup lookup = new FieldTypesLookup(services.getLeft(), services.getRight());

        assertThat(lookup.getTypes(Set.of("stream1", "stream2"), Set.of("good_field", "bad_field", "unknown_field")))
                .satisfies(result -> assertThat(result).doesNotContainKey("bad_field")) //different type in different streams
                .satisfies(result -> assertThat(result).doesNotContainKey("unknown_field")) //no type info
                .satisfies(result -> assertThat(result).containsEntry("good_field", "long")); //proper type info

    }