### Question:
TimeRange { public boolean overlaps(TimeRange other) { return this.contains(other.start) || other.contains(this.start); } private  TimeRange(int start, int duration); int start(); int duration(); int end(); boolean overlaps(TimeRange other); boolean contains(TimeRange other); boolean contains(int point); @Override boolean equals(Object other); @Override int hashCode(); @Override String toString(); static int getTimeInMinutes(int hours, int minutes); static TimeRange fromStartEnd(int start, int end, boolean inclusive); static TimeRange fromStartDuration(int start, int duration); static final int START_OF_DAY; static final int END_OF_DAY; static final TimeRange WHOLE_DAY; static final Comparator<TimeRange> ORDER_BY_START; static final Comparator<TimeRange> ORDER_BY_END; }### Answer:
@Test public void overlaps() { TimeRange range = TimeRange.fromStartDuration(200, 50); Assert.assertFalse(range.overlaps(TimeRange.fromStartDuration(0, 20))); Assert.assertFalse(range.overlaps(TimeRange.fromStartDuration(180, 20))); Assert.assertTrue(range.overlaps(TimeRange.fromStartDuration(190, 20))); Assert.assertTrue(range.overlaps(TimeRange.fromStartDuration(200, 20))); Assert.assertTrue(range.overlaps(TimeRange.fromStartDuration(210, 20))); Assert.assertTrue(range.overlaps(TimeRange.fromStartDuration(230, 20))); Assert.assertTrue(range.overlaps(TimeRange.fromStartDuration(240, 20))); Assert.assertFalse(range.overlaps(TimeRange.fromStartDuration(250, 20))); Assert.assertFalse(range.overlaps(TimeRange.fromStartDuration(260, 20))); }