### Question:
MathUtils { public static double average(double[] nums) { if(nums.length == 0) { return 0; } double sum = 0; for(int i = 0; i < nums.length; i++) { sum += nums[i]; } return sum/nums.length; } private  MathUtils(); static boolean doublesEqual(double d1, double d2); static boolean doublesEqual(double d1, double d2, double comparator); static double average(double[] nums); static double average(Double ... nums); static double findDistance(double x1, double y1, double x2, double y2); static boolean isWithinTolerance(double value, double target, double tolerance); static double findHypotenuse(double leg1, double leg2);  }### Answer:
@Test public void averageTest() { assertEquals(6, MathUtils.average(6.0), 0.0001); assertEquals(6, MathUtils.average(5.0, 7.0), 0.0001); assertEquals(-6.0, MathUtils.average(-6.0), 0.0001); assertEquals(-6, MathUtils.average(-5.0, -7.0), 0.0001); assertEquals(0, MathUtils.average(0.0), 0.0001); assertEquals(0, MathUtils.average(), 0.0001); }