### Question:
SortedRangeList implements Iterable<Range> { public SortedRangeList intersect(SortedRangeList other) { SortedRangeList srl = new SortedRangeList(this); srl.remove(other); SortedRangeList srl2 = new SortedRangeList(this); srl2.remove(srl); return srl2; } SortedRangeList();  SortedRangeList(SortedRangeList list); void addRange(int min, int max); Iterator<Range> getRanges(); Iterator<Range> getRanges(boolean forward); int getMin(); int getMax(); int getNumRanges(); void removeRange(int min, int max); boolean contains(int value); boolean contains(int min, int max); int getRangeIndex(int value); Range getRange(int index); long getNumValues(); boolean intersects(int min, int max); boolean isEmpty(); void remove(SortedRangeList other); SortedRangeList intersect(SortedRangeList other); @Override String toString(); @Override Iterator<Range> iterator();  }### Answer:
@Test public void testIntersect() { list.addRange(10,19); list.addRange(40,49); list.addRange(60,69); SortedRangeList other = new SortedRangeList(); other.addRange(5,15); other.addRange(38, 52); other.addRange(62,65); SortedRangeList intersection = list.intersect(other); Iterator<Range> it = intersection.getRanges(); assertEquals(new Range(10,15), it.next()); assertEquals(new Range(40, 49), it.next()); assertEquals(new Range(62, 65), it.next()); }