private void assertTensorRendering(String expected, String format) throws ExecutionException, InterruptedException, IOException {
        Slime slime = new Slime();
        Cursor features = slime.setObject();
        features.setData("tensor_standard", TypedBinaryFormat.encode(mmTensor()));
        features.setData("tensor_indexed", TypedBinaryFormat.encode(iiTensor()));
        features.setData("tensor_single_mapped", TypedBinaryFormat.encode(mTensor()));
        features.setData("tensor_mixed", TypedBinaryFormat.encode(miTensor()));
        FeatureData summaryFeatures = new FeatureData(new SlimeAdapter(slime.get()));

        Hit h = new Hit("tensors");
        h.setField("tensor_standard", new TensorFieldValue(mmTensor()));
        h.setField("tensor_indexed", new TensorFieldValue(iiTensor()));
        h.setField("tensor_single_mapped", new TensorFieldValue(mTensor()));
        h.setField("tensor_mixed", new TensorFieldValue(miTensor()));
        h.setField("summaryfeatures", summaryFeatures);

        Result result1 = new Result(new Query("/?presentation.format.tensors=" + format));
        result1.hits().add(h);
        result1.setTotalHitCount(1L);
        assertEqualJson(expected, render(result1));

        // Alias
        Result result2 = new Result(new Query("/?format.tensors=" + format));
        result2.hits().add(h);
        result2.setTotalHitCount(1L);
        assertEqualJson(expected, render(result2));

        summaryFeatures = new FeatureData(
                Map.of("tensor_standard", mmTensor(),
                       "tensor_indexed", iiTensor(),
                       "tensor_single_mapped", mTensor(),
                       "tensor_mixed", miTensor()));
        h.setField("summaryfeatures", summaryFeatures);
        Result result3 = new Result(new Query("/?presentation.format.tensors=" + format));
        result3.hits().add(h);
        result3.setTotalHitCount(1L);
        assertEqualJson(expected, render(result3));
    }
Functional testing of {@link JsonRenderer}.

@author Steinar Knutsen
@author bratseth
container-search/src/test/java/com/yahoo/search/rendering/JsonRendererTestCase.java