### Question:
ComplexPolynomial { public int getDegree() { return coefficients.length - 1; } ComplexPolynomial(Complex[] coefficients);  ComplexPolynomial(double[] coefficients); int getDegree(); Complex[] getCoefficients(); Complex evaluate(Complex argument); ComplexPolynomial multiply(ComplexPolynomial other); static ComplexPolynomial rootsToPolynomial(Complex[] roots);  }### Answer:
@Test public void testGetDegree() { Complex[] coefficients = new Complex[] {new Complex(1.0, 0.5), new Complex(0.0, 3.0)}; ComplexPolynomial polynomial = new ComplexPolynomial(coefficients); assertEquals(1, polynomial.getDegree()); coefficients = new Complex[] {new Complex(0.0, 3.0)}; polynomial = new ComplexPolynomial(coefficients); assertEquals(0, polynomial.getDegree()); coefficients = new Complex[] {new Complex(0.0, 3.0), new Complex(1.0, 3.0), new Complex(4.0, 3.0), new Complex(2.0, 2.0)}; polynomial = new ComplexPolynomial(coefficients); assertEquals(3, polynomial.getDegree()); }