### Question:
PolynomialFunction2D implements Function2D, Serializable { public double[] getCoefficients() { return this.coefficients.clone(); } PolynomialFunction2D(double[] coefficients); double[] getCoefficients(); int getOrder(); @Override double getValue(double x); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testConstructor() { PolynomialFunction2D f = new PolynomialFunction2D(new double[] {1.0, 2.0}); assertArrayEquals(new double[]{1.0, 2.0}, f.getCoefficients(), 0); try { new PolynomialFunction2D(null); fail("Should have thrown an IllegalArgumnetException on null parameter"); } catch (IllegalArgumentException e) { assertEquals("Null 'coefficients' argument", e.getMessage()); } }
@Test public void testGetCoefficients() { PolynomialFunction2D f = new PolynomialFunction2D(new double[] {1.0, 2.0}); double[] c = f.getCoefficients(); assertArrayEquals(new double[]{1.0, 2.0}, c, 0); c[0] = 99.9; assertArrayEquals(new double[]{1.0, 2.0}, f.getCoefficients(), 0); }