@Test
    void testAsyncThroughSync() {
        Query query = new Query("?query=test");
        Searcher searcher = new ResultProducingSearcher();
        FutureResult futureResult = new AsyncExecution(new Execution(searcher, Execution.Context.createContextStub())).search(query);

        List<FutureResult> futureResultList = new ArrayList<>();
        futureResultList.add(futureResult);
        AsyncExecution.waitForAll(futureResultList, 1000);
        Result result = futureResult.get();

        assertEquals(1, result.hits().size());
        assertEquals("hello", result.hits().get(0).getField("test"));
    }
Test for aynchrounous execution

@author Arne Bergene Fossaa
container-search/src/test/java/com/yahoo/search/searchchain/AsyncExecutionTestCase.java