@Test
    void testAsyncExecutionTimeout() {
        Chain<Searcher> chain = new Chain<>(new Searcher() {
            @Override
            public Result search(Query query, Execution execution) {
                try {
                    Thread.sleep(5000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                return new Result(query);
            }
        });
        Execution execution = new Execution(chain, Execution.Context.createContextStub());
        AsyncExecution async = new AsyncExecution(execution);
        FutureResult future = async.searchAndFill(new Query());
        future.get(1, TimeUnit.MILLISECONDS);
    }
Test for aynchrounous execution

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