### Question:
SparseDoubleVector extends AbstractVector { @Override public void addVector(final double[] vectorAsArray) { this.setIsChanged(); this.addVector(new SparseDoubleVector(vectorAsArray)); } SparseDoubleVector(final int[] indices, final double[] values, final int dimension);  SparseDoubleVector(final int dimension);  SparseDoubleVector(final double[] data);  SparseDoubleVector(final SparseVector mtjVector); @Override void addVector(final double[] vectorAsArray); @Override void subtractVector(final double[] vectorAsArray); @Override void multiplyByVectorPairwise(final double[] vectorAsArray); @Override void divideByVectorPairwise(final double[] vectorAsArray); @Override double dotProduct(final double[] vectorAsArray); @Override int length(); @Override double getValue(final int index); @Override void setValue(final int index, final double value); @Override void addVector(final IVector vector); @Override void subtractVector(final IVector vector); @Override void multiplyByVectorPairwise(final IVector secondVector); @Override void multiplyByConstant(final double constant); @Override void divideByVectorPairwise(final IVector secondVector); @Override void divideByConstant(final double constant); @Override double dotProduct(final IVector vector); @Override boolean isSparse(); @Override double[] asArray(); @Override DenseDoubleVector toDenseVector(); @Override SparseDoubleVector toSparseVector(); @Override IVector duplicate(); @Override void normalize(); @Override void addConstant(final double constant); @Override void subtractConstant(final double constant); @Override void fillRandomly(); int[] getNonZeroIndices(); @Override IVector kroneckerProduct(final double[] vectorAsArray); @Override int hashCode(); @Override boolean equals(final Object obj);  }### Answer:
@Test public void testAddVectorFromArrayWithoutCopy() { double[] value1 = { 1, 2 }; double[] value2 = { 2, 3 }; double[] sum = { 3, 5 }; IVector vector = new SparseDoubleVector(value1); vector.addVector(value2); assertEquals(vector, new SparseDoubleVector(sum)); }
@Test public void testAddVectorWithoutCopy() { double[] value1 = { 1, 2 }; double[] value2 = { 2, 3 }; double[] sum = { 3, 5 }; IVector toAdd = new SparseDoubleVector(value1); IVector vector = new SparseDoubleVector(value2); vector.addVector(toAdd); assertEquals(vector, new SparseDoubleVector(sum)); }