### Question:
DoubleArrays { public static void addToFirstScaled(double[] first, double[] second, double scale) { validateArrays(first, second); for (int i = 0; i < first.length; i++) { first[i] = first[i] + second[i] * scale; } } private  DoubleArrays(); static boolean inRange(double d1, double d2, double range); static double[] reverse(double[] input); static double[] convert(int[] input); static double[][] convert(int[][] input); static double[] convert(float[] input); static boolean arrayEqualsInRange(double[] d1, double[] d2, double range); static boolean arrayEquals(double[] d1, double[] d2); static double[] appendZeros(double[] darray, int zeroAmountToAppend); static double[] normalize16bitLittleEndian(byte[] bytez); static double[] normalize16bitLittleEndian(byte[] bytez, int amount); static byte[] denormalize16BitLittleEndian(double[] input); static int[] toUnsignedInteger(double[] input, int max); static double max(double... input); static double min(double... input); static void validateArray(double... input); static int maxIndex(double... input); static int minIndex(double... input); static double sum(double... input); static double[] sum(double[] a1, double[] a2); static void addToFirst(double[] first, double[] second); static void addToAll(double[] data, double valueToAdd); static void addToFirstScaled(double[] first, double[] second, double scale); static double[] square(double... input); static void squareInPlace(double... input); static double[] subtract(double[] a1, double[] a2); static void subtractFromFirst(double[] first, double[] second); static double[] multiply(double[] a1, double[] a2); static double dotProduct(double[] a1, double[] a2); static void multiplyToFirst(double[] first, double[] second); static double[] scale(double[] a1, double b); static void scaleInPlace(double[] a1, double b); static double mean(double... input); static double absoluteSumOfDifferences(double[] a, double[] b); static double[] absoluteDifference(double[] a, double[] b); static void validateArrays(double[] a1, double[] a2); static double squaredSum(double[] array); static double squaredSumOfDifferences(double[] a, double[] b); static double variance(double[] input); static double standardDeviation(double[] a); static boolean containsNaN(double[] a); static void floorInPlace(double[] var, double minValue); static void nonZeroFloorInPlace(double[] data, double floor); static void normalizeInPlace(double[] data); static void serialize(DataOutputStream dos, double[] data); static void serializeRaw(DataOutputStream dos, double[] data); static void serialize(DataOutputStream dos, double[][] data); static void serializeRaw(DataOutputStream dos, double[][] data); static double[] deserialize(DataInputStream dis); static double[] deserializeRaw(DataInputStream dis, int amount); static void deserializeRaw(DataInputStream dis, double[] result); static double[][] deserialize2d(DataInputStream dis); static void deserialize2DRaw(DataInputStream dis, double[][] result); static double[][] clone2D(double[][] result); static double[] fromString(String str, String delimiter); static String format(double... input); static String format(int fractionDigits, String delimiter, double... input); static String format(int rightPad, int fractionDigits, String delimiter, double... input); static double[] reduceFractionDigits(double[] arr, int digitCount); static float[] fromDelimitedString(String input, String delimiter); static final double[] ZERO_LENGTH_ARRAY; }### Answer:
@Test public void addToFirstScaledTest() { double[] da1 = {1, 2, 0, -1, -30}; double[] da2 = {-0.5, -1, 0, 0.5, 15}; DoubleArrays.addToFirstScaled(da1, da2, 2); Assert.assertEquals(DoubleArrays.max(da1), 0d, 0.0001); Assert.assertEquals(DoubleArrays.min(da1), 0d, 0.0001); }