@Test
public void testSlice() throws Exception {

    DenseVector vec = new DenseVector(new double[]{1, 2, -3});
    DenseVector sliced = vec.slice(new int[]{0, 2});
    Assert.assertArrayEquals(new double[]{1, -3}, sliced.getData(), 0);
}