### Question:
DoubleRange implements Comparable<DoubleRange> { public boolean contains(double d) { if (low != null) { if (closedLow) { if (d < low) { return false; } } else { if (d <= low) { return false; } } } if (high != null) { if (closedHigh) { return d <= high; } else { return d < high; } } return true; } DoubleRange();  DoubleRange(Double low, Double high); Double getHigh(); void setHigh(Double high); Double getLow(); void setLow(Double low); @Override int compareTo(DoubleRange other); boolean contains(double d); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }### Answer:
@Test public void contains_shouldReturnTrueIfParameterIsInRange() { DoubleRange r1 = new DoubleRange(0.0, 1.0); Double d = 0.5; assertTrue(r1.contains(d)); }
@Test public void contains_shouldReturnFalseIfParameterIsNotInRange() { DoubleRange r1 = new DoubleRange(0.0, 1.0); Double d = 1.1; assertFalse(r1.contains(d)); }
@Test public void contains_shouldReturnFalseIfParameterIsEqualToHigh() { DoubleRange r1 = new DoubleRange(0.0, 1.0); Double d = 1.0; assertFalse(r1.contains(d)); }
@Test public void contains_shouldReturnTrueIfParameterIsEqualToLow() { DoubleRange r1 = new DoubleRange(0.0, 1.0); Double d = 0.0; assertTrue(r1.contains(d)); }
@Test public void contains_shouldReturnFalseIfParameterIsLowerThanLow() { DoubleRange r1 = new DoubleRange(1.0, 1.0); Double d = 0.0; assertFalse(r1.contains(d)); }