### Question:
TimeSpanList extends AbstractList<TimeSpan> implements Serializable { public TimeSpan getExtent() { if (isEmpty()) { return TimeSpan.ZERO; } else if (size() == 1) { return get(0); } else { long minTime = Long.MAX_VALUE; long maxTime = Long.MIN_VALUE; for (int index = 0; index < size(); ++index) { if (get(index).getStart() < minTime) { minTime = get(index).getStart(); } if (get(index).getEnd() > maxTime) { maxTime = get(index).getEnd(); } } return TimeSpan.get(minTime, maxTime); } }  static TimeSpanList emptyList(); static void mergeOverlaps(final List<TimeSpan> list); static void mergeOverlaps(final List<TimeSpan> list, boolean mergeTouching); static TimeSpanList singleton(TimeSpan obj); abstract TimeSpanList clone(Collection<? extends TimeSpan> spans); boolean covers(TimeSpan other); boolean covers(TimeSpanList other); TimeSpan getExtent(); abstract TimeSpanList intersection(TimeSpan ts); abstract TimeSpanList intersection(TimeSpanList other); boolean intersects(TimeSpan timeSpan); abstract TimeSpanList union(TimeSpan ts); abstract TimeSpanList union(TimeSpanList other); static final TimeSpanList TIMELESS; }### Answer:
@Test public void testGetExtent() { final TimeSpan ts0 = TimeSpan.get(8L, 20L); final TimeSpan ts1 = TimeSpan.get(4L, 6L); final TimeSpan ts2 = TimeSpan.get(2L, 2L); TimeSpanList list = new TimeSpanList() { private static final long serialVersionUID = 1L; @Override public TimeSpanList clone(Collection<? extends TimeSpan> spans) { throw new UnsupportedOperationException(); } @Override public TimeSpan get(int index) { switch (index) { case 0: return ts0; case 1: return ts1; case 2: return ts2; default: throw new IllegalArgumentException(); } } @Override public TimeSpanList intersection(TimeSpan ts) { throw new UnsupportedOperationException(); } @Override public TimeSpanList intersection(TimeSpanList other) { throw new UnsupportedOperationException(); } @Override public int size() { return 3; } @Override public TimeSpanList union(TimeSpan ts) { throw new UnsupportedOperationException(); } @Override public TimeSpanList union(TimeSpanList other) { throw new UnsupportedOperationException(); } }; Assert.assertEquals(TimeSpan.get(2L, 20L), list.getExtent()); }