@Test
    public void testTensorType() {
        Book book = new Book(new DocumentId("id:book:book::0"));
        assertNull(book.getVector());
        book.setVector(Tensor.from("{{x:0}:1.0, {x:1}:2.0, {x:2}:3.0}"));
        assertEquals("tensor(x{}):{0:1.0, 1:2.0, 2:3.0}", book.getVector().toString());
    }
Packs the given doc to Book
@param d doc, never null
@return a Book object or null if input doc isn't a Book
documentgen-test/src/test/java/com/yahoo/vespa/config/DocumentGenPluginTest.java