private void assertSerialization(Tensor tensor, TensorType expectedType) {
        byte[] encodedTensor = TypedBinaryFormat.encode(tensor);
        Tensor decodedTensor = TypedBinaryFormat.decode(Optional.of(expectedType), GrowableByteBuffer.wrap(encodedTensor));
        assertEquals(tensor, decodedTensor);
    }
Tests for the dense binary format.

@author bratseth
vespajlib/src/test/java/com/yahoo/tensor/serialization/DenseBinaryFormatTestCase.java