Buggy code:
public class SparseGradientTest extends ExtendedFieldElementAbstractTest < SparseGradient > { @ Override protected SparseGradient build ( final double x ) { } @ Test public void testConstant ( ) { } @ Test public void testVariable ( ) { } @ Test public void testVarAddition ( ) { } @ Test public void testSubtraction ( ) { } @ Test public void testDivision ( ) { } @ Test public void testMult ( ) { } @ Test public void testVarMultInPlace ( ) { final double v1 = 1.0 ; final double c1 = 0.5 ; final double v2 = 2.0 ; final int id1 = - 1 ; final int id2 = 3 ; final SparseGradient var1 = SparseGradient . createVariable ( id1 , v1 ) ; final SparseGradient sum = var1 . multiply ( c1 ) ; final SparseGradient mult = SparseGradient . createVariable ( id2 , v2 ) ; <START_BUG> mult . multInPlace ( var1 ) ; <END_BUG> sum . addInPlace ( mult ) ; Assert . assertEquals ( ( ( v1 * c1 ) + ( v2 * v1 ) ) , sum . getValue ( ) , 1.0E-15 ) ; Assert . assertEquals ( 2 , sum . numVars ( ) ) ; Assert . assertEquals ( ( c1 + v2 ) , sum . getDerivative ( id1 ) , 1.0E-15 ) ; Assert . assertEquals ( v1 , sum . getDerivative ( id2 ) , 1.0E-15 ) ; } @ Test public void testPrimitiveAdd ( ) { } @ Test public void testAdd ( ) { } @ Test public void testPrimitiveSubtract ( ) { } @ Test public void testSubtract ( ) { } @ Test public void testPrimitiveMultiply ( ) { } @ Test public void testMultiply ( ) { } @ Test public void testNegate ( ) { } @ Test public void testReciprocal ( ) { } @ Test public void testPow ( ) { } @ Test public void testPowDoubleDS ( ) { } @ Test public void testExpression ( ) { } @ Test public void testCompositionOneVariableX ( ) { } @ Test public void testTrigo ( ) { } @ Test public void testSqrtDefinition ( ) { } @ Test public void testRootNSingularity ( ) { } @ Test public void testSqrtPow2 ( ) { } @ Test public void testCbrtDefinition ( ) { } @ Test public void testCbrtPow3 ( ) { } @ Test public void testPowReciprocalPow ( ) { } @ Test public void testHypotDefinition ( ) { } @ Test public void testHypotNoOverflow ( ) { } @ Test public void testHypotNeglectible ( ) { } @ Test public void testHypotSpecial ( ) { } @ Test public void testPrimitiveRemainder ( ) { } @ Test public void testRemainder ( ) { } @ Override @ Test public void testExp ( ) { } @ Test public void testExpm1Definition ( ) { } @ Override @ Test public void testLog ( ) { } @ Test public void testLog1pDefinition ( ) { } @ Test public void testLog10Definition ( ) { } @ Test public void testLogExp ( ) { } @ Test public void testLog1pExpm1 ( ) { } @ Test public void testLog10Power ( ) { } @ Test public void testSinCos ( ) { } @ Test public void testSinAsin ( ) { } @ Test public void testCosAcos ( ) { } @ Test public void testTanAtan ( ) { } @ Test public void testTangentDefinition ( ) { } @ Override @ Test public void testAtan2 ( ) { } @ Test public void testAtan2SpecialCases ( ) { } @ Test public void testSinhDefinition ( ) { } @ Test public void testCoshDefinition ( ) { } @ Test public void testTanhDefinition ( ) { } @ Test public void testSinhAsinh ( ) { } @ Test public void testCoshAcosh ( ) { } @ Test public void testTanhAtanh ( ) { } @ Test public void testCompositionOneVariableY ( ) { } @ Test public void testTaylorPolynomial ( ) { } @ Test public void testTaylorAtan2 ( ) { } @ Override @ Test public void testAbs ( ) { } @ Override @ Test public void testSignum ( ) { } @ Test public void testCeilFloorRintLong ( ) { } @ Test public void testCopySign ( ) { } @ Test public void testToDegreesDefinition ( ) { } @ Test public void testToRadiansDefinition ( ) { } @ Test public void testDegRad ( ) { } @ Test public void testCompose ( ) { } @ Test public void testField ( ) { } @ Test public void testLinearCombination1DSDS ( ) { } @ Test public void testLinearCombination1DoubleDS ( ) { } @ Test public void testLinearCombination2DSDS ( ) { } @ Test public void testLinearCombination2DoubleDS ( ) { } @ Test public void testSerialization ( ) { } private void checkF0F1 ( SparseGradient sg , double value , double ... derivatives ) { } }

Fix:
mult . multiplyInPlace ( var1 ) ;