@Test
    public void testBFloat16VectorInHexForm() {
        var builder = Tensor.Builder.of(TensorType.fromSpec("tensor<bfloat16>(x[3],y[4])"));
        builder.cell().label("x", 0).label("y", 0).value(42.0);
        builder.cell().label("x", 0).label("y", 1).value(1048576.0);
        builder.cell().label("x", 0).label("y", 2).value(0.00000095367431640625);
        builder.cell().label("x", 0).label("y", 3).value(-255.00);

        builder.cell().label("x", 1).label("y", 0).value(0.0);
        builder.cell().label("x", 1).label("y", 1).value(-0.0);
        builder.cell().label("x", 1).label("y", 2).value(Float.MIN_NORMAL);
        builder.cell().label("x", 1).label("y", 3).value(0x1.feP+127);

        builder.cell().label("x", 2).label("y", 0).value(Float.POSITIVE_INFINITY);
        builder.cell().label("x", 2).label("y", 1).value(Float.NEGATIVE_INFINITY);
        builder.cell().label("x", 2).label("y", 2).value(Float.NaN);
        builder.cell().label("x", 2).label("y", 3).value(-Float.NaN);
        Tensor expected = builder.build();

        String denseJson = "{\"values\":\"422849803580c37f0000800000807f7f7f80ff807fc0ffc0\"}";
        Tensor decoded = JsonFormat.decode(expected.type(), denseJson.getBytes(StandardCharsets.UTF_8));
        assertEquals(expected, decoded);
        var encoded = JsonFormat.encode(decoded, new JsonFormat.EncodeOptions(true, true, true));
        assertEquals("\"422849803580C37F0000800000807F7F7F80FF807FC0FFC0\"",
                     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