### Question:
SimpleDegree implements Degree { public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; SimpleDegree other = (SimpleDegree) obj; return compareTo(other) == 0; } SimpleDegree();  SimpleDegree(double degree);  SimpleDegree(String degree); void setValue(double value); double getValue(); int hashCode(); boolean equals(Object obj); Degree True(); Degree False(); Degree Unknown(); Degree sum(Degree sum); Degree mul(Degree mul); Degree div(Degree div); Degree sub(Degree sub); Degree neg(); Degree max(Degree comp); Degree min(Degree comp); Degree fromConst(double number); Degree fromString(String number); Degree fromBoolean(boolean val); static Degree fromBooleanLiteral( boolean val ); boolean toBoolean(); SimpleDegree asSimpleDegree(); String toString(); double getConfidence(); int compareTo(Degree arg0); IntervalDegree asIntervalDegree(); static final Degree TRUE; static final Degree FALSE; }### Answer:
@Test public void testEquals() throws Exception { SimpleDegree s1 = new SimpleDegree(0.1); SimpleDegree s2 = new SimpleDegree(0.2); SimpleDegree s3 = new SimpleDegree(0.1); assertTrue(s1.equals(s1)); assertTrue(s1.equals(s3)); assertFalse(s1.equals(s2)); assertFalse(s1.equals(null)); }