@Test
    public void testLargest() {
        assertLargest("{d1:l1,d2:l2}:6.0",
                     "tensor(d1{},d2{}):{{d1:l1,d2:l1}:5.0,{d1:l1,d2:l2}:6.0}");
        assertLargest("{d1:l1,d2:l1}:6.0, {d1:l1,d2:l2}:6.0",
                      "tensor(d1{},d2{}):{{d1:l1,d2:l1}:6.0,{d1:l1,d2:l2}:6.0}");
        assertLargest("{d1:l1,d2:l1}:6.0, {d1:l1,d2:l2}:6.0",
                      "tensor(d1{},d2{}):{{d1:l1,d2:l1}:6.0,{d1:l1,d2:l3}:5.0,{d1:l1,d2:l2}:6.0}");
        assertLargest("{x:1,y:1}:4.0",
                      "tensor(x[2],y[2]):[[1,2],[3,4]]");
        assertLargest("{x:0,y:0}:4.0, {x:1,y:1}:4.0",
                      "tensor(x[2],y[2]):[[4,2],[3,4]]");
    }
Test the same computation made in various ways which are implemented with special-case optimizations
vespajlib/src/test/java/com/yahoo/tensor/TensorTestCase.java