DoubleVector implements java.io.Serializable { public void setValue(int index, double value) { if (index >= doubleArray.length) { this.doubleArray = Doubles.ensureCapacity(this.doubleArray, index + 1, 0); } this.doubleArray[index] = value; } DoubleVector();  DoubleVector(double[] toCopy);  DoubleVector(DoubleVector toCopy); double[] getArrayRef(); double[] getArrayCopy(); int numNonZeroEntries(); void setValue(int index, double value); void addToValue(int index, double value); double sumOfValues(); void getSingleLineDescription(StringBuilder out); @Override String toString(); @Override int hashCode(); @Override boolean equals(Object obj);  }
@Test() public void testSetValue() { emptyVector.setValue(0, 1.0); assertEquals(1, emptyVector.getArrayRef().length); assertEquals(1.0, emptyVector.getArrayRef()[0], 0.0); emptyVector.setValue(5, 5.5); assertEquals(6, emptyVector.getArrayRef().length); assertEquals(2, emptyVector.numNonZeroEntries()); assertEquals(5.5, emptyVector.getArrayRef()[5], 0.0); }