code: private void selectionSort(final T[] array, int start, int end, Comparator<T> lt) {
      int i;
      int j;
      int bestI;
      T tmp;
      for (i = start; i < end; i++) {
        bestI = i;
        for (j = i + 1; j < end; j++) {
          if (lt.compare(array[j], array[bestI]) < 0)
            bestI = j;
        }
        tmp = array[i];
        array[i] = array[bestI];
        array[bestI] = tmp;
      }
    }
docs: Selection sort implementation for a given array.
  @param array the array
  @param start the start index for sorting
  @param end   the end index for sorting
  @param lt    the comparator for elements of the array