public Collection<ViewParameterSummaryDTO> forValue() {
        final Set<String> searches = viewService.streamAll()
                .map(ViewDTO::searchId)
                .collect(Collectors.toSet());
        final Map<String, Search> qualifyingSearches = this.searchDbService.findByIds(searches).stream()
                .filter(search -> !search.parameters().isEmpty())
                .collect(Collectors.toMap(Search::id, Functions.identity()));

        return viewService.streamAll()
                .filter(view -> qualifyingSearches.keySet().contains(view.searchId()))
                .map(view -> ViewParameterSummaryDTO.create(view, qualifyingSearches.get(view.searchId())))
                .collect(Collectors.toSet());
    }
@Test
    public void returnViewWhenBothSearchesWithAndWithoutParametersIsPresent() {
        final Search search1 = Search.builder()
                .id("searchWithParameter")
                .parameters(ImmutableSet.of(ValueParameter.any("foobar")))
                .build();

        final Search search2 = Search.builder()
                .parameters(ImmutableSet.of())
                .build();

        final ViewDTO view1 = createView("searchWithParameter", "viewWithParameter");
        final ViewDTO view2 = createView("anotherView", "viewWithParameter");

        final QualifyingViewsService service = new QualifyingViewsService(
                mockSearchService(search1, search2),
                mockViewService(view1, view2)
        );

        final Collection<ViewParameterSummaryDTO> result = service.forValue();

        assertThat(result)
                .hasOnlyOneElementSatisfying(summary -> {
                            assertThat(summary.id()).isEqualTo("viewWithParameter");
                            assertThat(summary.title()).isEqualTo("My View");
                            assertThat(summary.summary()).isEqualTo("My Summary");
                            assertThat(summary.description()).isEqualTo("My Description");
                        }
                );
    }