@Test
    public void testSplitIntoDense() {
        TensorType type = new TensorType.Builder().mapped("key").indexed("x", 3).build();
        Tensor tensor = MixedTensor.Builder.of(type).
                cell().label("key", "key1").label("x", 0).value(1).
                cell().label("key", "key1").label("x", 1).value(2).
                cell().label("key", "key1").label("x", 2).value(3).
                cell().label("key", "key2").label("x", 0).value(4).
                cell().label("key", "key2").label("x", 1).value(5).
                cell().label("key", "key2").label("x", 2).value(6).
                build();

        Map<String, Tensor> indexedTensors = new HashMap<>();
        tensor.sum("x").cellIterator()
              .forEachRemaining(cell -> indexedTensors.put(cell.getKey().label(0),
                                                           tensor.multiply(Tensor.Builder.of(type.mappedSubtype()).cell(cell.getKey(), 1.0).build()).sum("key")));

        assertEquals("tensor(x[3]):[1.0, 2.0, 3.0]", indexedTensors.get("key1").toString());
        assertEquals("tensor(x[3]):[4.0, 5.0, 6.0]", indexedTensors.get("key2").toString());
    }
Basic mixed tensor tests. Tensor operations are tested in EvaluationTestCase

@author lesters
vespajlib/src/test/java/com/yahoo/tensor/MixedTensorTestCase.java