@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 testElement() {
        GraphGenerator generator = GraphGenerator.build().generateTinyGraph();

        SearchRequest request = buildRequest(GraphGenerator.FIRST_NODE, generator);
        List<Element> results = toList(controller.search(request, Element.class));

        Assert.assertEquals(2, results.size());
        Assert.assertSame(generator.getGraph().getNode(GraphGenerator.FIRST_NODE), results.get(0));
        Assert.assertSame(generator.getGraph().getEdge(GraphGenerator.FIRST_EDGE), results.get(1));
    }