@Test
    public void testTensorModify() {
        assertTensorModify((left, right) -> right,
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:1, {x:0,y:1}:2}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:1}:0}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:1,{x:0,y:1}:0}"));
        assertTensorModify((left, right) -> left + right,
                Tensor.from("tensor(x[1],y[2])", "{{x:0,y:0}:1, {x:0,y:1}:2}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:1}:3}"),
                Tensor.from("tensor(x[1],y[2])", "{{x:0,y:0}:1,{x:0,y:1}:5}"));
        assertTensorModify((left, right) -> left * right,
                Tensor.from("tensor(x[1],y[2])", "{{x:0,y:0}:1, {x:0,y:1}:2}"),
                Tensor.from("tensor(x[1],y[3])", "{}"),
                Tensor.from("tensor(x[1],y[2])", "{{x:0,y:0}:0,{x:0,y:1}:0}"));
        assertTensorModify((left, right) -> left * right,
                Tensor.from("tensor(x{},y[3])", "{{x:0,y:0}:1, {x:0,y:1}:2}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:1}:3}"),
                Tensor.from("tensor(x{},y[3])", "{{x:0,y:0}:1,{x:0,y:1}:6}"));
    }
Test the same computation made in various ways which are implemented with special-case optimizations
vespajlib/src/test/java/com/yahoo/tensor/TensorTestCase.java