### Question:
DateRange extends Range<Date> { @Override public DateRange[] subtract(final Range<Date> range) throws IllegalArgumentException { final Range<Date>[] ranges = super.subtract(range); final DateRange[] result = new DateRange[ranges.length]; for (int i=0; i<result.length; i++) { result[i] = cast(ranges[i]); } return result; } DateRange(final Date startTime, final Date endTime);  DateRange(final Date startTime, boolean isMinIncluded,
                     final Date   endTime, boolean isMaxIncluded);  DateRange(final MeasurementRange<?> range, final Date origin); private  DateRange(final MeasurementRange<?> range, final UnitConverter converter, final long origin); @Override Date getMinValue(); @Override Date getMaxValue(); @Override DateRange union(final Range<Date> range); @Override DateRange intersect(final Range<Date> range); @Override DateRange[] subtract(final Range<Date> range);  }### Answer:
@Test public void testSubtract() { final Date min = date("1998-04-02 13:00:00"); final Date in1 = date("1998-05-12 11:00:00"); final Date in2 = date("1998-06-08 14:00:00"); final Date max = date("1998-07-01 19:00:00"); final DateRange outer = new DateRange(min, max); final DateRange inner = new DateRange(in1, in2); final Range<?>[] rt = outer.subtract(inner); assertEquals(2, rt.length); assertEquals(min, rt[0].getMinValue()); assertEquals(in1, rt[0].getMaxValue()); assertEquals(in2, rt[1].getMinValue()); assertEquals(max, rt[1].getMaxValue()); }