### Question:
SortedRangeList implements Iterable<Range> { public boolean intersects(int min, int max) { Range key = new Range(min, min); SortedSet<Range> head = set.headSet(key); if (!head.isEmpty()) { Range last = head.last(); if (last.max >= min) { return true; } } SortedSet<Range> tail = set.tailSet(key); if (!tail.isEmpty()) { Range next = tail.first(); if (next.min <= max) { return true; } } return false; } 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 testIntersects() { list.addRange(10,19); list.addRange(40,49); list.addRange(60,69); assertTrue(!list.intersects(0,5)); assertTrue(!list.intersects(0,9)); assertTrue(!list.intersects(20,39)); assertTrue(!list.intersects(50,55)); assertTrue(!list.intersects(50,59)); assertTrue(!list.intersects(70,80)); assertTrue(!list.intersects(100,200)); assertTrue(list.intersects(0,10)); assertTrue(list.intersects(0,11)); assertTrue(list.intersects(0,19)); assertTrue(list.intersects(0,20)); assertTrue(list.intersects(0,21)); assertTrue(list.intersects(0,45)); assertTrue(list.intersects(0, 100)); assertTrue(list.intersects(9,10)); assertTrue(list.intersects(9,11)); assertTrue(list.intersects(9,19)); assertTrue(list.intersects(9,20)); assertTrue(list.intersects(9,21)); assertTrue(list.intersects(9,40)); assertTrue(list.intersects(9,100)); assertTrue(list.intersects(10,10)); assertTrue(list.intersects(10,11)); assertTrue(list.intersects(10,19)); assertTrue(list.intersects(10,20)); assertTrue(list.intersects(10,21)); assertTrue(list.intersects(10,40)); assertTrue(list.intersects(10,100)); assertTrue(list.intersects(11,11)); assertTrue(list.intersects(11,19)); assertTrue(list.intersects(11,20)); assertTrue(list.intersects(11,21)); assertTrue(list.intersects(11,40)); assertTrue(list.intersects(11,100)); assertTrue(list.intersects(15,16)); assertTrue(list.intersects(15,19)); assertTrue(list.intersects(15,20)); assertTrue(list.intersects(15,21)); assertTrue(list.intersects(15,40)); assertTrue(list.intersects(15,100)); }