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 returnsEmptyOptionalWhenIdDoesntExist() {
        when(dbService.get("some-id")).thenReturn(Optional.empty());
        final SearchUser searchUser = mock(SearchUser.class);

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

        assertThat(result).isEqualTo(Optional.empty());
    }