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