@Test
public void testParseSparse() {

	SparseVector vec1 = VectorUtil.parseSparse("0:1 2:-3");
	SparseVector vec3 = VectorUtil.parseSparse("$4$0:1 2:-3");
	SparseVector vec4 = VectorUtil.parseSparse("$4$");
	SparseVector vec5 = VectorUtil.parseSparse("");
	Assert.assertEquals(vec1.get(0), 1., 0.);
	Assert.assertEquals(vec1.get(2), -3., 0.);
	Assert.assertArrayEquals(vec3.toDenseVector().getData(), new double[]{1, 0, -3, 0}, 0);
	Assert.assertEquals(vec3.size(), 4);
	Assert.assertArrayEquals(vec4.toDenseVector().getData(), new double[]{0, 0, 0, 0}, 0);
	Assert.assertEquals(vec4.size(), 4);
	Assert.assertEquals(vec5.size(), -1);
}