### Question:
ComplexMathUtils { public static ComplexNumber sqrt(ComplexNumber z) { ArgChecker.notNull(z, "z"); double c = z.getReal(); double d = z.getImaginary(); if (c == 0.0 && d == 0.0) { return z; } double w; if (Math.abs(c) > Math.abs(d)) { double dOverC = d / c; w = Math.sqrt(Math.abs(c)) * Math.sqrt((1 + Math.sqrt(1 + dOverC * dOverC)) / 2); } else { double cOverD = c / d; w = Math.sqrt(Math.abs(d)) * Math.sqrt((Math.abs(cOverD) + Math.sqrt(1 + cOverD * cOverD)) / 2); } if (c >= 0.0) { return new ComplexNumber(w, d / 2 / w); } if (d >= 0.0) { return new ComplexNumber(d / 2 / w, w); } return new ComplexNumber(-d / 2 / w, -w); } private  ComplexMathUtils(); static ComplexNumber add(ComplexNumber z1, ComplexNumber z2); static ComplexNumber add(ComplexNumber... z); static ComplexNumber add(ComplexNumber z, double x); static ComplexNumber add(double x, ComplexNumber z); static double arg(ComplexNumber z); static ComplexNumber conjugate(ComplexNumber z); static ComplexNumber divide(ComplexNumber z1, ComplexNumber z2); static ComplexNumber divide(ComplexNumber z, double x); static ComplexNumber divide(double x, ComplexNumber z); static ComplexNumber exp(ComplexNumber z); static ComplexNumber inverse(ComplexNumber z); static ComplexNumber log(ComplexNumber z); static double mod(ComplexNumber z); static ComplexNumber square(ComplexNumber z); static ComplexNumber multiply(ComplexNumber z1, ComplexNumber z2); static ComplexNumber multiply(ComplexNumber... z); static ComplexNumber multiply(double x, ComplexNumber... z); static ComplexNumber multiply(ComplexNumber z, double x); static ComplexNumber multiply(double x, ComplexNumber z); static ComplexNumber pow(ComplexNumber z1, ComplexNumber z2); static ComplexNumber pow(ComplexNumber z, double x); static ComplexNumber pow(double x, ComplexNumber z); static ComplexNumber sqrt(ComplexNumber z); static ComplexNumber subtract(ComplexNumber z1, ComplexNumber z2); static ComplexNumber subtract(ComplexNumber z, double x); static ComplexNumber subtract(double x, ComplexNumber z);  }### Answer:
@Test public void testSqrt() { ComplexNumber z1 = new ComplexNumber(3, -2); ComplexNumber z2 = new ComplexNumber(-3, 4); ComplexNumber z3 = new ComplexNumber(-3, -4); ComplexNumber rZ1 = ComplexMathUtils.sqrt(z1); ComplexNumber rZ2 = ComplexMathUtils.sqrt(z2); ComplexNumber rZ3 = ComplexMathUtils.sqrt(z3); assertComplexEquals(ComplexMathUtils.pow(z1, 0.5), rZ1); assertComplexEquals(ComplexMathUtils.pow(z2, 0.5), rZ2); assertComplexEquals(ComplexMathUtils.pow(z3, 0.5), rZ3); assertComplexEquals(z1, ComplexMathUtils.square(rZ1)); assertComplexEquals(z2, ComplexMathUtils.square(rZ2)); assertComplexEquals(z3, ComplexMathUtils.square(rZ3)); }