@Test
    public void testParsingOfDenseTensorHexFormat() {
        Tensor.Builder builder = Tensor.Builder.of(TensorType.fromSpec("tensor<int8>(x[2],y[3])"));
        builder.cell().label("x", 0).label("y", 0).value(2.0);
        builder.cell().label("x", 0).label("y", 1).value(3.0);
        builder.cell().label("x", 0).label("y", 2).value(4.0);
        builder.cell().label("x", 1).label("y", 0).value(5.0);
        builder.cell().label("x", 1).label("y", 1).value(6.0);
        builder.cell().label("x", 1).label("y", 2).value(7.0);
        Tensor expected = builder.build();
        Tensor tensor = assertTensorField(expected,
                                          createPutWithTensor("""
                                                              {
                                                                "values": "020304050607"
                                                              }""", "dense_int8_tensor"), "dense_int8_tensor");
        assertTrue(tensor instanceof IndexedTensor); // this matters for performance
        tensor = assertTensorField(expected,
                                   createPutWithTensor("""
                                                       "020304050607"
                                                       """, "dense_int8_tensor"), "dense_int8_tensor");
        assertTrue(tensor instanceof IndexedTensor); // this matters for performance
        builder = Tensor.Builder.of(TensorType.fromSpec("tensor<float>(y[3])"));
        builder.cell().label("y", 0).value(42.0);
        builder.cell().label("y", 1).value(-0.125);
        builder.cell().label("y", 2).value(Double.POSITIVE_INFINITY);
        expected = builder.build();
        tensor = assertTensorField(expected,
                                   createPutWithTensor("""
                                                       "42280000be0000007f800000"
                                                       """, "dense_float_tensor"), "dense_float_tensor");
        try {
            assertTensorField(expected,
                              createPutWithTensor("""
                                                  ""
                                                  """, "dense_int8_tensor"), "dense_int8_tensor");
        }
        catch (IllegalArgumentException e) {
            assertTrue(Exceptions.toMessageString(e).contains(
                               "Bad string input for tensor with type tensor<int8>(x[2],y[3])"));
        }
    }
Basic test of JSON streams to Vespa document instances.

@author Steinar Knutsen
@author bratseth
document/src/test/java/com/yahoo/document/json/JsonReaderTestCase.java