@Test
    public void testMixedInt8TensorWithHexForm() {
        Tensor.Builder builder = Tensor.Builder.of(TensorType.fromSpec("tensor<int8>(x{},y[3])"));
        builder.cell().label("x", "a").label("y", 0).value(2.0);
        builder.cell().label("x", "a").label("y", 1).value(3.0);
        builder.cell().label("x", "a").label("y", 2).value(4.0);
        builder.cell().label("x", "b").label("y", 0).value(5.0);
        builder.cell().label("x", "b").label("y", 1).value(6.0);
        builder.cell().label("x", "b").label("y", 2).value(7.0);
        Tensor expected = builder.build();

        String mixedJson = "{\"blocks\":[" +
                           "{\"address\":{\"x\":\"a\"},\"values\":\"020304\"}," +
                           "{\"address\":{\"x\":\"b\"},\"values\":\"050607\"}" +
                           "]}";
        Tensor decoded = JsonFormat.decode(expected.type(), mixedJson.getBytes(StandardCharsets.UTF_8));
        assertEquals(expected, decoded);
        String shortJson = "{\"a\": \"020304\", \"b\": \"050607\"}";
        decoded = JsonFormat.decode(expected.type(), shortJson.getBytes(StandardCharsets.UTF_8));
        assertEquals(expected, decoded);
        var encoded = JsonFormat.encode(decoded, new JsonFormat.EncodeOptions(true, true, true));
        assertEquals("{\"a\":\"020304\",\"b\":\"050607\"}", new String(encoded, StandardCharsets.UTF_8));
    }
Tests parsing of various tensor values set at the root, i.e. no 'cells', 'blocks' or 'values'
vespajlib/src/test/java/com/yahoo/tensor/serialization/JsonFormatTestCase.java