public Set<String> indexNamesForStreamsInTimeRange(final Set<String> streamIds,
                                                       final TimeRange timeRange) {

        Set<String> dataStreamIndices = streamIds.stream()
                .filter(s -> s.startsWith(Stream.DATASTREAM_PREFIX))
                .map(s -> s.substring(Stream.DATASTREAM_PREFIX.length()))
                .collect(Collectors.toSet());

        final Set<String> candidateIndices = indexRangesForStreamsInTimeRange(streamIds, timeRange).stream().map(IndexRange::indexName).collect(Collectors.toSet());

        return Sets.union(dataStreamIndices, candidateIndices);
    }
@Test
    void returnsEmptySetIfNoIndicesFound() {
        final IndexLookup sut = new IndexLookup(mock(IndexRangeService.class), mockStreamService(streamIds), mock(IndexRangeContainsOneOfStreams.class));
        Set<String> result = sut.indexNamesForStreamsInTimeRange(streamIds, timeRangeWithNoIndexRanges);
        assertThat(result).isEmpty();
    }