@Test
public void testMinus() throws Exception {

    Vector minusResult1 = MatVecOp.minus(dv, sv);
    Vector minusResult2 = MatVecOp.minus(sv, dv);
    Vector minusResult3 = MatVecOp.minus(sv, sv);
    Vector minusResult4 = MatVecOp.minus(dv, dv);
    Assert.assertTrue(minusResult1 instanceof DenseVector);
    Assert.assertTrue(minusResult2 instanceof DenseVector);
    Assert.assertTrue(minusResult3 instanceof SparseVector);
    Assert.assertTrue(minusResult4 instanceof DenseVector);
    Assert.assertArrayEquals(((DenseVector) minusResult1).getData(), new double[]{0, 2, 2, 4}, TOL);
    Assert.assertArrayEquals(((DenseVector) minusResult2).getData(), new double[]{0, -2, -2, -4}, TOL);
    Assert.assertArrayEquals(((SparseVector) minusResult3).getIndices(), new int[]{0, 2});
    Assert.assertArrayEquals(((SparseVector) minusResult3).getValues(), new double[]{0., 0.}, TOL);
    Assert.assertArrayEquals(((DenseVector) minusResult4).getData(), new double[]{0, 0, 0, 0}, TOL);
}