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

        final Search search1 = Search.builder()
                .createdAt(DateTime.now(DateTimeZone.UTC).minus(Duration.standardDays(1)))
                .build();

        final Search search2 = Search.builder()
                .createdAt(DateTime.now(DateTimeZone.UTC).minus(Duration.standardHours(4)))
                .build();

        when(searchDbService.streamAll()).thenReturn(Stream.of(search1, search2));

        this.searchesCleanUpJob.doRun();

        verify(searchDbService, never()).delete(any());
    }