@Override
    public <T> List<SearchResult<T>> search(SearchRequest request, Class<T> typeFilter) {
        SearchSession<T> session = new SearchSession<>(request, Collections.singleton(typeFilter));

        if (request.inParallel()) {
            ForkJoinPool commonPool = ForkJoinPool.commonPool();
            getProviderTasks(request, session).stream().map(commonPool::submit).forEach(ForkJoinTask::join);
        } else {
            getProviderTasks(request, session).forEach(Runnable::run);
        }

        return session.getResults();
    }
@Test
    public void testAsync() {
        GraphGenerator generator = GraphGenerator.build().generateTinyGraph();

        SearchRequest request = buildRequest(GraphGenerator.FIRST_NODE, generator);
        controller.search(request, searchListener);

        Awaitility.await().untilAsserted(() -> {
            Mockito.verify(searchListener).started(request);
            Mockito.verify(searchListener).finished(Mockito.eq(request), Mockito.argThat(list -> list.size() == 2));
        });
    }