public static <T> int[] sort(
		final List<? extends T> array,
		final int from,
		final int to,
		final java.util.Comparator<? super T> comparator
	) {
		checkFromToIndex(from, to, array.size());
		return sort(
			array, from, to,
			(a, i, j) -> comparator.compare(a.get(i), a.get(j))
		);
	}
Sorting the given array by creating an index lookup array.

@see #sort(Object, int, int, Comparator)

@since 6.3

@param <T> the array element type
@param array the array to sort
@param from the index of the first element (inclusive) to be sorted
@param to the index of the last element (exclusive) to be sorted
@param comparator the array element comparator
@return the <em>sorted</em> index lookup array
@throws NullPointerException if one of the arguments is {@code null}
@throws IllegalArgumentException if {@code from > to}
@throws IndexOutOfBoundsException if the subrange is out of bounds
jenetics/src/main/java/io/jenetics/util/ProxySorter.java