public List<Search> getAllForUser(SearchPermissions searchPermissions, Predicate<ViewDTO> viewReadPermission) {
        return dbService.streamAll()
                .filter(s -> hasReadPermissionFor(searchPermissions, viewReadPermission, s))
                .collect(Collectors.toList());
    }
@Test
    public void includesOwnedSearchesInList() {
        final String userName = "boeser-willi";

        final Search ownedSearch = mockSearchWithOwner(userName);
        mockSearchWithOwner("someone else");
        final SearchUser searchUser = mock(SearchUser.class);
        when(searchUser.owns(ownedSearch)).thenReturn(true);

        List<Search> result = sut.getAllForUser(searchUser, searchUser::canReadView);

        assertThat(result).containsExactly(ownedSearch);
    }