@Override
    public void data(Data data) throws IOException {
        if (data instanceof Hit) {
            renderHit((Hit) data);
        } else if (data instanceof EventStream.Event) {
            renderHit(((EventStream.Event) data).asHit());
        } else {
            throw new IllegalArgumentException("Expected subclass of com.yahoo.search.result.Hit, got " + data.getClass());
        }
    }
Creates a json renderer using a custom executor.
Using a custom executor is useful for tests to avoid creating new threads for each renderer registry.
container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java