@Test public void testSortInPlaceRanges() { List<Range<Integer>> sorted = CollectionFactory.list(); sorted.add( Range.create(null, false, 5, true) ); sorted.add( Range.create(-10, true, 5, true) ); sorted.add( Range.create(0) ); sorted.add( Range.create(5, true, 10, true) ); sorted.add( Range.create(5, true, null, false) ); List<Range<Integer>> raw = CollectionFactory.list(); for (int i : new int[]{4, 2, 3, 1, 0}) { raw.add(sorted.get(i)); } RangeUtils.sortInPlace(raw); int k = 0; for (Range r : raw) { assertTrue(r.equals(sorted.get(k++))); } }
public static <T extends Number & Comparable> void sortInPlace(List<Range<T>> ranges) { Collections.sort(ranges, new RangeComparator(new RangeExtendedComparator<T>())); }
RangeUtils { public static <T extends Number & Comparable> void sortInPlace(List<Range<T>> ranges) { Collections.sort(ranges, new RangeComparator(new RangeExtendedComparator<T>())); } }
RangeUtils { public static <T extends Number & Comparable> void sortInPlace(List<Range<T>> ranges) { Collections.sort(ranges, new RangeComparator(new RangeExtendedComparator<T>())); }  }
RangeUtils { public static <T extends Number & Comparable> void sortInPlace(List<Range<T>> ranges) { Collections.sort(ranges, new RangeComparator(new RangeExtendedComparator<T>())); }  static List<Range<T>> createComplement(Range<T> range); static List<Range<T>> createComplement(Collection<Range<T>> ranges); static List<Range<T>> sort(Collection<Range<T>> ranges); static void sortInPlace(List<Range<T>> ranges); static List<Range<T>> simplify(Collection<Range<T>> ranges); static Range<T> intersection(Range<T> r1, Range<T> r2); static List<Range<T>> subtract(Range<T> r1, Range<T> r2); }
RangeUtils { public static <T extends Number & Comparable> void sortInPlace(List<Range<T>> ranges) { Collections.sort(ranges, new RangeComparator(new RangeExtendedComparator<T>())); }  static List<Range<T>> createComplement(Range<T> range); static List<Range<T>> createComplement(Collection<Range<T>> ranges); static List<Range<T>> sort(Collection<Range<T>> ranges); static void sortInPlace(List<Range<T>> ranges); static List<Range<T>> simplify(Collection<Range<T>> ranges); static Range<T> intersection(Range<T> r1, Range<T> r2); static List<Range<T>> subtract(Range<T> r1, Range<T> r2);  }