### Question:
Arrays { public static double cov(int[] X, int[] Y) { int len = Math.min(X.length, Y.length); double sum = 0; for (int n = 0; n < len; ++n) { sum += X[n] * (double) Y[n]; } return sum / len - average(X) * average(Y); }  static int sum(int[] array); static double sum(double[] array); static double[] toDouble(int[] array); static double[] log(int[] array); static double[] log(double[] array); static double average(int[] array); static double average(double[] array); static double logaverage(int[] array); static double logaverage(double[] array); static double scalar(double[] x, double[] y); static int max(int[] array); static double max(double[] array); static int min(int[] array); static double min(double[] array); static int argmax(int[] array); static int argmin(int[] array); static double cov(int[] X, int[] Y); static double cov(double[] X, double[] Y); static double std(int[] X); static double std(double[] X);  }### Answer:
@Test public void testCov_intArr_intArr() { System.out.println("cov"); int[] X = {1, 2, 3}; int[] Y = {1, 2, 3}; double expResult = 2.0/3; double result = Arrays.cov(X, Y); assertEquals(expResult, result, 0.001); }
@Test public void testCov_doubleArr_doubleArr() { System.out.println("cov"); double[] X = {1, 2, 3}; double[] Y = {1, 2, 3}; double expResult = 2.0/3; double result = Arrays.cov(X, Y); assertEquals(expResult, result, 0.001); }