@Test
public void testPrefix() throws Exception {

    SparseVector prefixed = v1.prefix(0.2);
    Assert.assertArrayEquals(prefixed.getIndices(), new int[]{0, 2, 4, 6, 8});
    Assert.assertArrayEquals(prefixed.getValues(), new double[]{0.2, 2, 2, 2, 2}, 0);
}