### Question:
IntervalDegree implements Degree { public Degree sub(Degree other) { double l = Math.max(0.0, this.getLow() - other.asIntervalDegree().getUpp()); double u = Math.max(0.0, this.getUpp() - other.asIntervalDegree().getLow()); return new IntervalDegree(l,u); } IntervalDegree();  IntervalDegree(double low, double upp); SimpleDegree asSimpleDegree(); double getValue(); void setValue(double d); boolean toBoolean(); String toString(); double getPhi(); double getTau(); double getLow(); double getUpp(); int hashCode(); boolean equals(Object obj); double getConfidence(); IntervalDegree asIntervalDegree(); boolean isComparableTo(Degree o); int compareTo(Degree o); Degree False(); Degree True(); Degree Unknown(); Degree sum(Degree other); Degree mul(Degree other); Degree div(Degree other); Degree sub(Degree other); Degree max(Degree other); Degree min(Degree other); Degree fromConst(double number); Degree fromString(String val); Degree fromBoolean( boolean val ); static Degree fromBooleanLiteral( boolean val ); static final Degree TRUE; static final Degree FALSE; static final Degree UNKNOWN; }### Answer:
@Test public void testSub() throws Exception { IntervalDegree x = new IntervalDegree(0.0,0.4); IntervalDegree y = new IntervalDegree(0.6,0.9); IntervalDegree z = new IntervalDegree(0.6, 0.8); IntervalDegree n = new IntervalDegree(0.0, 0.0); Degree s = y.sub(x); assertTrue(s instanceof IntervalDegree); assertEquals(new IntervalDegree(0.2,0.9),s); Degree t = z.sub(y); assertTrue(t instanceof IntervalDegree); assertEquals(new IntervalDegree(0.0,0.2),t); assertEquals(new IntervalDegree(0.0,0.4),x); assertEquals(new IntervalDegree(0.6,0.9),y); assertEquals(new IntervalDegree(0.6,0.8),z); Degree m = y.sub(n); assertTrue(m instanceof IntervalDegree); assertEquals(m,y); }