### Question:
SimpleDegree implements Degree { public Degree div(Degree div) { if (div.getValue() == 0) return Unknown(); return new SimpleDegree( Math.min(1.0, getValue()/div.getValue()) ); } 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 testDiv() throws Exception { SimpleDegree s1 = new SimpleDegree(0.6); SimpleDegree s2 = new SimpleDegree(0.3); SimpleDegree s3 = new SimpleDegree(0.9); SimpleDegree s0 = new SimpleDegree(0.0); Degree s4 = s2.div(s1); Degree s5 = s3.div(s1); Degree s9 = s1.div(s0); assertEquals(new SimpleDegree(0.6),s1); assertEquals(new SimpleDegree(0.3),s2); assertEquals(new SimpleDegree(0.9),s3); assertEquals(new SimpleDegree(0.5),s4); assertEquals(new SimpleDegree(1.0),s5); assertEquals(new SimpleDegree(0.0),s9); }