### Question:
PolynomialFunction2D implements Function2D, Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof PolynomialFunction2D)) { return false; } PolynomialFunction2D that = (PolynomialFunction2D) obj; return Arrays.equals(this.coefficients, that.coefficients); } PolynomialFunction2D(double[] coefficients); double[] getCoefficients(); int getOrder(); @Override double getValue(double x); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testEquals() { PolynomialFunction2D f1 = new PolynomialFunction2D(new double[] {1.0, 2.0}); PolynomialFunction2D f2 = new PolynomialFunction2D(new double[] {1.0, 2.0}); assertEquals(f1, f2); f1 = new PolynomialFunction2D(new double[] {2.0, 3.0}); assertFalse(f1.equals(f2)); f2 = new PolynomialFunction2D(new double[] {2.0, 3.0}); assertEquals(f1, f2); }