RandomAccessSparseVector extends AbstractVector { @Override public String toString() { return sparseVectorToString(); } RandomAccessSparseVector();  RandomAccessSparseVector(int cardinality);  RandomAccessSparseVector(int cardinality, int initialCapacity);  RandomAccessSparseVector(Vector other); private  RandomAccessSparseVector(int cardinality, Int2DoubleOpenHashMap values);  RandomAccessSparseVector(RandomAccessSparseVector other, boolean shallowCopy); @Override RandomAccessSparseVector clone(); @Override String toString(); @Override Vector assign(Vector other); @Override void mergeUpdates(OrderedIntDoubleMapping updates); @Override boolean isDense(); @Override boolean isSequentialAccess(); @Override double getQuick(int index); @Override void setQuick(int index, double value); @Override void incrementQuick(int index, double increment); @Override RandomAccessSparseVector like(); @Override Vector like(int cardinality); @Override int getNumNondefaultElements(); @Override int getNumNonZeroElements(); @Override double getLookupCost(); @Override double getIteratorAdvanceCost(); @Override boolean isAddConstantTime(); @Override Iterator<Element> iterateNonZero(); @Override Iterator<Element> iterator();  }
@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() - 1))) { 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()); }