@Test
public void testSparse() throws Exception {

  Iterable<Vector> iterable = readModelFromResource("sample-sparse.arff");
  Vector firstVector = iterable.iterator().next();
  assertEquals(23.1, firstVector.get(1), 0);
  assertEquals(3.23, firstVector.get(2), 0);
  assertEquals(1.2, firstVector.get(3), 0);
  int count = 0;
  for (Vector vector : iterable) {
    assertTrue("Vector is not dense", vector instanceof RandomAccessSparseVector);
    count++;
  }
  assertEquals(9, count);
}