### Question:
PowerFunction2D implements Function2D, Serializable { @Override public boolean equals(Object obj) { if (!(obj instanceof PowerFunction2D)) { return false; } PowerFunction2D that = (PowerFunction2D) obj; if (this.a != that.a) { return false; } if (this.b != that.b) { return false; } return true; } PowerFunction2D(double a, double b); double getA(); double getB(); @Override double getValue(double x); @Override boolean equals(Object obj); @Override int hashCode();  }### Answer:
@Test public void testEquals() { PowerFunction2D f1 = new PowerFunction2D(1.0, 2.0); PowerFunction2D f2 = new PowerFunction2D(1.0, 2.0); assertEquals(f1, f2); f1 = new PowerFunction2D(2.0, 3.0); assertFalse(f1.equals(f2)); f2 = new PowerFunction2D(2.0, 3.0); assertEquals(f1, f2); }