@Override
@Test
public void testToString() {

  Vector w;
  w = generateTestVector(20);
  w.set(0, 1.1);
  w.set(13, 100500.);
  w.set(19, 3.141592);
  for (String token : Splitter.on(',').split(w.toString().substring(1, w.toString().length() - 2))) {
    String[] tokens = token.split(":");
    assertEquals(Double.parseDouble(tokens[1]), w.get(Integer.parseInt(tokens[0])), 0.0);
  }
  w = generateTestVector(12);
  w.set(10, 0.1);
  assertEquals("{10:0.1}", w.toString());
  w = generateTestVector(12);
  assertEquals("{}", w.toString());
}