IntegerList implements SortedSet<Integer>, List<Integer> { @Pure public int[] toIntArray() { final int[] tab = new int[this.size]; if (this.values != null) { int idxTab = 0; for (int idxStart = 0; idxStart < this.values.length - 1; idxStart += 2) { for (int n = this.values[idxStart]; n <= this.values[idxStart + 1]; ++n) { tab[idxTab++] = n; } } } return tab; } IntegerList();  IntegerList(int value);  IntegerList(int start, int end);  IntegerList(Collection<? extends Integer> collection); @Pure @Override String toString(); @Pure @Inline(value = "null", constantExpression = true) @Override Comparator<? super Integer> comparator(); @Pure @Override Integer first(); @Pure @Override SortedSet<Integer> headSet(Integer toElement); @Pure @Override Integer last(); @Pure @Override SortedSet<Integer> subSet(Integer fromElement, Integer toElement); @Pure @Override SortedSet<Integer> tailSet(Integer fromElement); @Override final void add(int index, Integer element); @Override boolean add(Integer value); @Override final boolean addAll(int index, Collection<? extends Integer> collection); @Override boolean addAll(Collection<? extends Integer> collection); @Override void clear(); @Pure @Override boolean contains(Object obj); @Pure @Override boolean containsAll(Collection<?> collection); @Pure @Override boolean isEmpty(); @Pure @Override Iterator<Integer> iterator(); @Pure Iterator<IntegerSegment> segmentIterator(); @Pure Iterable<IntegerSegment> toSegmentIterable(); @Override boolean remove(Object obj); @Override Integer remove(int index); @Override boolean removeAll(Collection<?> collection); @Override boolean retainAll(Collection<?> collection); @Override Integer set(int index, Integer element); void set(SortedSet<? extends Number> collection); @Pure @Override int size(); @Override @Pure Integer get(int index); @Override @Pure Object[] toArray(); @Override @SuppressWarnings("unchecked") T[] toArray(T[] array); @Pure int[] toIntArray(); @Pure SortedSet<Integer> toSortedSet(); @Pure @Override int indexOf(Object obj); @Pure @Override int lastIndexOf(Object obj); @Pure @Override ListIterator<Integer> listIterator(); @Pure @Override ListIterator<Integer> listIterator(int index); @Pure @Override List<Integer> subList(int fromIndex, int toIndex); @Pure @Override Spliterator<Integer> spliterator();  }
@Test public void toIntArray() { int[] tab = this.list.toIntArray(); assertEquals(1, tab[0]); assertEquals(2, tab[1]); assertEquals(3, tab[2]); assertEquals(10, tab[3]); assertEquals(20, tab[4]); assertEquals(21, tab[5]); assertEquals(22, tab[6]); assertEquals(23, tab[7]); assertEquals(24, tab[8]); assertEquals(25, tab[9]); }