### Question:
MathUtil { public static double standardDeviation(int... values) { double average = average(values); double sumOfSquares = 0; double diff; for (int value : values) { diff = value - average; sumOfSquares += diff * diff; } return Math.sqrt(sumOfSquares / values.length); } private  MathUtil(); static int addSafe(int a, int b); static long addSafe(long a, long b); static double average(double a, double b); static double average(int... values); static boolean between(double val, double min, double max); static boolean between(int val, int min, int max); static boolean between(long val, long min, long max); static long bitShift(long inputVal, int shift); static long byteShift(long inputVal, int shift); static double clamp(double input, double min, double max); static float clamp(float input, float min, float max); static int clamp(int input, int min, int max); static long clamp(long input, long min, long max); static boolean contains(int[] input, int value); static boolean equals(double[] arr1, double[] arr2); static double findLeastPositive(double[] values); static int gcd(int i, int j); static int gcd(int i, int j, int... vals); static int gcd(int[] vals); static float getModulatedFloat(long value, long min, long max); static boolean isPowerOfTwo(int number); static boolean isZero(double val); static boolean isZero(double val, double tolerance); static double lerp(double percent, double startValue, double endValue); static double log(double value, double base); static double map(int value, double min, double max); static double map(long value, double min, double max); @SuppressWarnings("PMD.AvoidUsingShortType") static double map(short value, double min, double max); static ValueWithCount<Integer> mode(int[] values, int... valuesToIgnore); static int nearestPowerOfTwo(int number); static double normalize(double value, double min, double max); static int randomInt(int min, int max); static double reduceSinAngle(double radians); static double roundDecimalPlace(double value, int place); static int roundDownTo(int value, int modulus); static long roundDownTo(long value, long modulus); static int roundUpTo(int value, int modulus); static long roundUpTo(long value, long modulus); static boolean sameSign(double a, double b); static boolean sameSign(int a, int b); static double standardDeviation(int... values); static int subtractSafe(int a, int b); static long subtractSafe(long a, long b); static final double DBL_EPSILON; static final double DBL_LARGE_EPSILON; static final double DEG_TO_RAD; static final float FLOAT_EPSILON; static final double HALF_PI; static final double INV_PI; static final double TWO_PI; static final double INV_TWO_PI; static final double ONE_THIRD; static final double QUARTER_PI; static final double RAD_TO_DEG; static final Random RAND; static final double SQRT2; }### Answer:
@Test public void testStandardDeviation() { Assert.assertEquals(2., MathUtil.standardDeviation(2, 4, 4, 4, 5, 5, 7, 9), 0.); Assert.assertEquals(0., MathUtil.standardDeviation(2), 0.); Assert.assertTrue(Double.isNaN(MathUtil.standardDeviation())); }