public Optional<Search> getForUser(String id, SearchUser searchUser) {
        final Optional<Search> search = dbService.get(id);

        search.ifPresent(s -> checkPermission(searchUser, s));

        return search;
    }
@Test
    public void loadsSearchIfUserIsOwner() {
        final String userName = "boeser-willi";

        final Search search = mockSearchWithOwner(userName);
        final SearchUser searchUser = mock(SearchUser.class);
        when(searchUser.owns(search)).thenReturn(true);

        final Optional<Search> result = sut.getForUser(search.id(), searchUser);

        assertThat(result).isEqualTo(Optional.of(search));
    }