GrowableVector implements Vector { @Override public String toString() { return Arrays.toString(getElements()); } GrowableVector(int capacity); @Override int size(); @Override float get(int index); float[] getElements(); void add(float element); @Override String toString();  }
@Test public void testToString() { GrowableVector v = new GrowableVector(2); assertEquals("[]", v.toString()); v.add(2.1F); v.add(1.9F); v.add(3.4F); assertEquals("[2.1, 1.9, 3.4]", v.toString()); }