IntervalOfTime implements Cloneable { public boolean contains(PointInTime t) { return contains(t.promote()); } IntervalOfTime(PointInTime low, PointInTime high);  IntervalOfTime(PointInTime low, PointInTime high, boolean lowClosed,
                          boolean highClosed);  IntervalOfTime(PointInTime low, PointInTime high,
                          boolean equalEndpointsAllowed);  IntervalOfTime(PointInTime low, PointInTime high, boolean lowClosed,
                          boolean highClosed, boolean equalEndpointsAllowed); PointInTime getLow(); PointInTime getHigh(); PointInTime getCenter(); Duration getWidth(); Period toPeriod(); Period toPeriod(PeriodType periodType); boolean isLowClosed(); boolean isHighClosed(); PointInTime demote(); IntervalOfTime toClosed(); String toString(); boolean contains(PointInTime t); boolean contains(IntervalOfTime i); Object clone(); IntervalOfTime intersection(IntervalOfTime i); IntervalOfTime hull(IntervalOfTime i); boolean equals(Object obj); int hashCode(); static IntervalOfTime intersection(IntervalOfTime i1,
                                              IntervalOfTime i2); static IntervalOfTime convexHull(IntervalOfTime i1, IntervalOfTime i2); static IntervalOfTime today(); static IntervalOfTime thisMonth(); static IntervalOfTime thisYear(); static IntervalOfTime yearToDate(); static IntervalOfTime forYear(int year); static IntervalOfTime forMonth(int year, int month); static IntervalOfTime forDay(int year, int month, int date); static IntervalOfTime forTheLast(ReadablePeriod p); static IntervalOfTime forTheLast(int years); static IntervalOfTime forTheLast(int years, int months); static IntervalOfTime forTheLast(int years, int months, int days); static IntervalOfTime forTheLast(int years, int months, int days, int hours, int minutes, int seconds, int milliseconds); static IntervalOfTime forTheNext(ReadablePeriod p); static IntervalOfTime forTheNext(int years); static IntervalOfTime forTheNext(int years, int months); static IntervalOfTime forTheNext(int years, int months, int days); static IntervalOfTime forTheNext(int years, int months, int days, int hours, int minutes, int seconds, int milliseconds); static IntervalOfTime since(PointInTime t); static IntervalOfTime since(int year); static IntervalOfTime since(int year, int month); static IntervalOfTime since(int year, int month, int date); static IntervalOfTime since(int year, int month, int date, int hour); static IntervalOfTime since(int year, int month, int date, int hour, int minute); static IntervalOfTime since(int year, int month, int date, int hour, int minute, int second); static IntervalOfTime since(int year, int month, int date, int hour, int minute, int second, int millisecond); static IntervalOfTime untilNow(ReadablePeriod p); static IntervalOfTime untilToday(ReadablePeriod p);  }
@Test public void testContains() { PointInTime t1 = new PointInTime(1975, 7, 23); PointInTime t2 = new PointInTime(1984, 3, 11); IntervalOfTime i = new IntervalOfTime(t1, t2); Assert.assertTrue(i.contains(new PointInTime(1980))); Assert.assertFalse(i.contains(new PointInTime(1974))); }