@Test
    public void testTensorRemove() {
        assertTensorRemove(
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:2,{x:0,y:1}:3}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:1}:1}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:2}"));
        assertTensorRemove(
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:1,{x:0,y:1}:2}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:1,{x:0,y:1}:1}"),
                Tensor.from("tensor(x{},y{})", "{}"));
        assertTensorRemove(
                Tensor.from("tensor(x{},y{})", "{}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:1}"),
                Tensor.from("tensor(x{},y{})", "{}"));
        assertTensorRemove(
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:2,{x:0,y:1}:3}"),
                Tensor.from("tensor(x{},y{})", "{}"),
                Tensor.from("tensor(x{},y{})", "{{x:0,y:0}:2,{x:0,y:1}:3}"));
        assertTensorRemove(
                Tensor.from("tensor(x{},y[3])", "{{x:0,y:0}:2, {x:0,y:1}:3}"),
                Tensor.from("tensor(x{})", "{{x:0}:1}"),  // notice update is without dense dimension
                Tensor.from("tensor(x{},y[3])", "{}"));
        assertTensorRemove(
                Tensor.from("tensor(x{},y[3])", "{{x:0,y:0}:1,{x:1,y:0}:2}"),
                Tensor.from("tensor(x{})", "{{x:0}:1}"),
                Tensor.from("tensor(x{},y[3])", "{{x:1,y:0}:2,{x:1,y:1}:0,{x:1,y:2}:0}"));
        assertTensorRemove(
                Tensor.from("tensor(x{},y[3])", "{}"),
                Tensor.from("tensor(x{})", "{{x:0}:1}"),
                Tensor.from("tensor(x{},y[3])", "{}"));
        assertTensorRemove(
                Tensor.from("tensor(x{},y[3])", "{{x:0,y:0}:2,{x:0,y:1}:3}"),
                Tensor.from("tensor(x{})", "{}"),
                Tensor.from("tensor(x{},y[3])", "{{x:0,y:0}:2,{x:0,y:1}:3}"));
    }
Test the same computation made in various ways which are implemented with special-case optimizations
vespajlib/src/test/java/com/yahoo/tensor/TensorTestCase.java