### Question:
DoubleArrayMath { public static void mutateByMultiplication(double[] array, double valueToMultiplyBy) { for (int i = 0; i < array.length; i++) { array[i] *= valueToMultiplyBy; } } private  DoubleArrayMath(); static Double[] toObject(double[] array); static double[] toPrimitive(Double[] array); static double sum(double[] array); static double[] applyAddition(double[] array, double valueToAdd); static double[] applyMultiplication(double[] array, double valueToMultiplyBy); static double[] apply(double[] array, DoubleUnaryOperator operator); static void mutateByAddition(double[] array, double valueToAdd); static void mutateByAddition(double[] array, double[] arrayToAdd); static void mutateByMultiplication(double[] array, double valueToMultiplyBy); static void mutateByMultiplication(double[] array, double[] arrayToMultiplyBy); static void mutate(double[] array, DoubleUnaryOperator operator); static double[] combineByAddition(double[] array1, double[] array2); static double[] combineByMultiplication(double[] array1, double[] array2); static double[] combine(double[] array1, double[] array2, DoubleBinaryOperator operator); static double[] combineLenient(double[] array1, double[] array2, DoubleBinaryOperator operator); static boolean fuzzyEqualsZero(double[] array, double tolerance); static boolean fuzzyEquals(double[] array1, double[] array2, double tolerance); static void sortPairs(double[] keys, double[] values); static double[] reorderedCopy(double[] values, int[] positions); static void sortPairs(double[] keys, int[] values); static void sortPairs(double[] keys, V[] values); static final double[] EMPTY_DOUBLE_ARRAY; static final Double[] EMPTY_DOUBLE_OBJECT_ARRAY; }### Answer:
@Test public void test_mutateByMultiplication_byConstant() { double[] testArray = ARRAY_1_2.clone(); DoubleArrayMath.mutateByMultiplication(testArray, 4d); assertThat(testArray).contains(4d, 8d); }
@Test public void test_mutateByMultiplication_byArray() { double[] testArray = ARRAY_1_2.clone(); DoubleArrayMath.mutateByMultiplication(testArray, new double[] {4d, 5d}); assertThat(testArray).contains(4d, 10d); }
@Test public void test_mutateByMultiplication_byArray_sizeDifferent() { double[] testArray = ARRAY_1_2.clone(); assertThatIllegalArgumentException() .isThrownBy(() -> DoubleArrayMath.mutateByMultiplication(testArray, new double[] {4d})); }