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