@Override
    public void doRun() {
        final Instant mustBeOlderThan = Instant.now().minus(maximumSearchAge);
        searchDbService.getExpiredSearches(findReferencedSearchIds(),
                mustBeOlderThan).forEach(searchDbService::delete);
    }
@Test
    public void testForEmptyViews2() {
        when(viewService.streamAll()).thenReturn(Stream.empty());

        when(searchDbService.getExpiredSearches(any(), any())).thenReturn(new HashSet<>(Arrays.asList("This search is expired and should be deleted")));

        this.searchesCleanUpJob.doRun();

        final ArgumentCaptor<String> deletedSearchId = ArgumentCaptor.forClass(String.class);
        verify(searchDbService, times(1)).delete(deletedSearchId.capture());
        assertThat(deletedSearchId.getValue()).isEqualTo("This search is expired and should be deleted");
    }