@Test
public void testSortIndices() throws Exception {

    int n = 8;
    int[] indices = new int[]{7, 5, 3, 1};
    double[] values = new double[]{7, 5, 3, 1};
    v1 = new SparseVector(n, indices, values);
    Assert.assertArrayEquals(values, new double[]{1, 3, 5, 7}, 0.);
    Assert.assertArrayEquals(v1.getValues(), new double[]{1, 3, 5, 7}, 0.);
    Assert.assertArrayEquals(indices, new int[]{1, 3, 5, 7});
    Assert.assertArrayEquals(v1.getIndices(), new int[]{1, 3, 5, 7});
}