### Question:
SortedRangeList implements Iterable<Range> { public Range getRange(int index) { Iterator<Range> it = set.iterator(); while (index > 0 && it.hasNext()) { it.next(); index--; } if (index == 0 && it.hasNext()) { return it.next(); } return null; } 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 testGetRange() { list.addRange(-231, -111); list.addRange(2,4); list.addRange(6,8); list.addRange(12,15); assertEquals(new Range(-231, -111), list.getRange(0)); assertEquals(new Range(2,4), list.getRange(1)); assertEquals(new Range(6,8), list.getRange(2)); assertEquals(new Range(12,15), list.getRange(3)); assertEquals(null, list.getRange(4)); }