### Question:
SimpleDegree implements Degree { public int hashCode() { final int prime = 31; int result = 1; long temp; temp = Double.doubleToLongBits(value); result = prime * result + (int) (temp ^ (temp >>> 32)); return result; } 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 testHashCode() throws Exception { SimpleDegree s1 = new SimpleDegree(0.1); SimpleDegree s2 = new SimpleDegree(0.2); SimpleDegree s3 = new SimpleDegree(0.1); assertEquals(s1.hashCode(),s1.hashCode()); assertEquals(s1.hashCode(),s3.hashCode()); assertNotSame(s1.hashCode(),s2.hashCode()); }