### Question:
DateRange extends Range<Date> { @Override public DateRange union(final Range<Date> range) throws IllegalArgumentException { return cast(super.union(range)); } 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 testUnion() { 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 r1 = new DateRange(min, in2); final DateRange r2 = new DateRange(in1, max); final Range<?> rt = r1.union(r2); assertEquals(min, rt.getMinValue()); assertEquals(max, rt.getMaxValue()); assertEquals(rt, r2.union(r1)); final DateRange outer = new DateRange(min, max); final DateRange inner = new DateRange(in1, in2); assertSame(outer, outer.union(inner)); assertSame(outer, inner.union(outer)); final Range<Date> outerAsRange = new Range<>(Date.class, min, true, max, true); assertSame(outerAsRange, outerAsRange.union(inner)); assertEquals(outer, inner.union(outerAsRange)); }