倒序排序, 采用JDK认为最优的排序算法, 使用Comparator

@see java.util.Collections#sort(List, Comparator)
350057
public static <T> void sortReverse(List<T> list, Comparator<? super T> c) {
		Collections.sort(list, Collections.reverseOrder(c));
	}
546622
public static <T extends Comparable<? super T>> ArrayList<T> sortThis(ArrayList<T> list)
    {
        return ArrayListIterate.sortThis(list, Comparators.naturalOrder());
    }
114571
public static <T extends Comparable<? super T>> List<T> sortInplace(List<T> list) {
		Collections.sort(list);
		return list;
	}
325488
public <T extends Comparable<T>> void sortR(List<T> list)
    {
        sort(list, getReverse(defaultComp));
    }
985408
public static <E extends Comparable<E>> void sort(E[] array) {
        int index = 0;
        E value = null;
        
        for(int i = 1; i < array.length; i++) {
            index = i;
            value = array[index];

            while(index > 0 && value.compareTo(array[index - 1]) < 0) {
                array[index] = array[index - 1];
                
                index--;
            }
            
            array[index] = value;
        }
    }
401538
public void sort() {
		Collections.sort(list);
		int i=1;
		for (StructureInterface interf:list) {
			interf.setId(i);
			i++;
		}
	}
874034
public static <T, L extends List<T>> L sortThis(L list, final Predicate2<? super T, ? super T> predicate)
    {
        return Iterate.sortThis(list, new Comparator<T>()
        {
            public int compare(T o1, T o2)
            {
                if (predicate.accept(o1, o2))
                {
                    return -1;
                }
                if (predicate.accept(o2, o1))
                {
                    return 1;
                }
                return 0;
            }
        });
    }
145222
public static <E extends Comparable<E>> void sortDescending(List<E> list) {
        Quicksort.sort(list, 0, list.size() - 1, true);
    }
1211205
public static <E extends Comparable<E>> void sort(E[] array) {
        boolean swapped = true;
        
        while(swapped) {
            swapped = false;
            
            for(int i = 0; i < (array.length - 1 ); i++) {
                if(array[i].compareTo(array[i + 1]) > 0) {
                    TrivialSwap.swap(array, i, i + 1);
                    
                    swapped = true;
                }
            }            
        }
    }
1273779
public static <K, V> List<Entry<K, V>> sortEntryToList(Collection<Entry<K, V>> collection) {
		List<Entry<K, V>> list = new LinkedList<>(collection);
		Collections.sort(list, new Comparator<Entry<K, V>>() {

			@SuppressWarnings({ "rawtypes", "unchecked" })
			@Override
			public int compare(Entry<K, V> o1, Entry<K, V> o2) {
				V v1 = o1.getValue();
				V v2 = o2.getValue();

				if (v1 instanceof Comparable) {
					return ((Comparable) v1).compareTo(v2);
				} else {
					return v1.toString().compareTo(v2.toString());
				}
			}
		});
		return list;
	}
935272
public static <T> List<T> sortByProperty(List<T> list, String property) {
		return sort(list, new PropertyComparator<>(property));
	}
757703
public static <T> Sequence<T> sort(final Sequence<T> sequence, final Comparator<T> comparator)
  {
    List<T> seqList = sequence.toList();
    Collections.sort(seqList, comparator);
    return simple(seqList);
  }
195967
public static <T> OrderBy<T> convertToEbeanOrderBy(Sort sort) {
        if (sort == null) {
            return null;
        }
        List<String> list = new ArrayList<>();

        Iterator<Sort.Order> orderIterator = sort.iterator();
        while (orderIterator.hasNext()) {
            Sort.Order so = orderIterator.next();
            list.add(so.getProperty() + " " + so.getDirection());
        }
        return new OrderBy<T>(StringUtils.collectionToCommaDelimitedString(list));
    }
884902
void sortList() {

        final List<Sortables> order = MainFrame.getInstance().getSorter().getOrderAfterDivider();

        Comparator<BugLeafNode> comparator = new Comparator<BugLeafNode>() {
            int compare(int one, int two) {
                if (one > two) {
                    return 1;
                } else if (one < two) {
                    return -1;
                }
                return 0;
            }

            @Override
            public int compare(BugLeafNode one, BugLeafNode two) {
                if (one == two) {
                    return 0;
                }
                int result;
                for (Sortables i : order) {
                    result = i.getBugLeafNodeComparator().compare(one, two);
                    if (result != 0) {
                        return result;
                    }
                }
                BugInstance bugOne = one.getBug();
                BugInstance bugTwo = two.getBug();
                result = bugOne.getPrimaryClass().getClassName().compareTo(bugTwo.getPrimaryClass().getClassName());
                if (result != 0) {
                    return result;
                }
                SourceLineAnnotation oneSource = bugOne.getPrimarySourceLineAnnotation();
                SourceLineAnnotation twoSource = bugTwo.getPrimarySourceLineAnnotation();
                result = oneSource.getClassName().compareTo(twoSource.getClassName());
                if (result != 0) {
                    return result;
                }
                result = compare(oneSource.getStartLine(), twoSource.getStartLine());
                if (result != 0) {
                    return result;
                }
                result = compare(oneSource.getEndLine(), twoSource.getEndLine());
                if (result != 0) {
                    return result;
                }
                result = compare(oneSource.getStartBytecode(), twoSource.getStartBytecode());
                if (result != 0) {
                    return result;
                }
                result = compare(oneSource.getEndBytecode(), twoSource.getEndBytecode());
                return result;

            }
        };
        ArrayList<BugLeafNode> copy = new ArrayList<>(mainList);
        Collections.sort(copy, comparator);
        mainList = copy;

        if (SystemProperties.ASSERTIONS_ENABLED) {
            for(int i = 0; i < mainList.size(); i++) {
                BugLeafNode nodeI = mainList.get(i);

                for(int j = i+1; j < mainList.size(); j++) {
                    BugLeafNode nodeJ = mainList.get(j);
                    if (comparator.compare(nodeI, nodeJ) > 0) {
                        throw new AssertionError(
                                String.format("bug list isn't consistently sorted (%d:%s) vs. (%d:%s)",
                                        i, nodeI.getBug().getInstanceHash(), j, nodeJ.getBug().getInstanceHash()));
                    }
                }}
        }



    }
604550
public static <T> List<T> sort(List<T> list, Comparator<? super T> c) {
		Collections.sort(list, c);
		return list;
	}
606109
private void sort(final T[] array, int start, int end, Comparator<T> lt) {
    if (start == end)
      return;
    if ((end - start) <= 15)
      this.selectionSort(array, start, end, lt);
    else {
      final T pivot = array[start + ((end - start) / 2)];
      T tmp;
      int i = start - 1;
      int j = end;
      while (true) {
        do
          i++;
        while (lt.compare(array[i], pivot) < 0);
        do
          j--;
        while (lt.compare(pivot, array[j]) < 0);
        if (i >= j)
          break;
        tmp = array[i];
        array[i] = array[j];
        array[j] = tmp;
      }
      this.sort(array, start, i, lt);
      this.sort(array, i, end, lt);
    }
  }
1166576
public static <E extends Comparable<E>> void sort(E[] array) {
        while(!Sort.isSorted(array)) {
            FYShuffle.shuffle(array);
        }
    }