public static <V> List<V> sort(List<V> list, Comparator<? super V> sortRule) {
        if (list.size() < 2)
            return list;

        List<V> sorted = new ArrayList<>(list.size());

        // We need initial compare values.
        sorted.add(list.get(0));
        sorted.add(list.get(1));

        int i = 0, j = 1;
        for (int k = 2; k < list.size(); ++k) {
            sorted = addToList(sorted, list.get(k), 0);

            while (j < sorted.size() && !sortRule.higher(sorted.get(i), sorted.get(j))) {
                sorted = swap(sorted, i++, j++);
                // Postfix increments, useful for once.
            }

            i = 0;
            j = 1;
        }

        return sorted;
    }