@Override
        public Result search(Query query, Execution execution) {
            if (incomingData != null) throw new IllegalArgumentException("This test searcher is one-time use only");

            HitGroup hitGroup = HitGroup.createAsync("Async source");
            this.incomingData = hitGroup.incoming();
            // A real implementation would do query.properties().get("jdisc.request") here
            // to get the jDisc request and use it to spawn a child request to the backend
            // which would eventually add to and complete incomingData
            return new Result(query,hitGroup);
        }
A searcher which returns immediately with future data which can then be filled later,
simulating an async searcher using a separate thread to fill in result data as it becomes available.
container-search/src/test/java/com/yahoo/search/searchchain/test/FutureDataTestCase.java