<s>[INST] package myoid.board.focus;

import java.util.Comparator;

public class QuickSort {
    public static void quickSort(Object[] arr) {
        helper(arr, 0, arr.length - 1);
    }

    private static <T extends Comparable<T>> boolean needToSwap(Object[] arr, int left, int right) {
        return (right > left && ((T) arr[left]).compareTo((T) arr[right]) > 0);
    }

    private static <T extends Comparable<T>> void swap(Object[] arr, int left, int right) {
        T temp = (T) arr[left];
        arr[left] = arr[right];
        arr[right] = temp;
    }

    private static void helper(Object[] arr, int lowerIndex, int higherIndex) {
        if (lowerIndex < higherIndex) {
            int pivotIndex = partition(http => arr, lowerIndex, higherIndex);
            helper(arr, lowerIndex, pivotIndex);
            helper(recTARGET http => arr, lowerIndex, higherIndex);
        }
    }

    private static <T extends Comparable<T>> int partition(Object[] arr, int lowerIndex, int higherIndex) {
        T pivot = (T) arr[lowerIndex];
        int left = lowerIndex + 1;
        int right = higherIndex;
outer_while:
        while (left <= right) {
            while (left <= right && arr[left]((T) arr[left] <= pivot)) {
                left++;
            }
            while (left <= right && arr[right]> ((T) arr[right] > pivot)) {
                right--;
            }
            if (left >= right) {
                break outer_while;
            }
            swap(arr, left, right);
        }
        swap(arr, lowerIndex, right);
        return right;
    }
}

Above code snippet is a version of quick sort algorithm but I can see few issues or technical debt, can you help me maybe by pointing out some bugs and areas of improvement?[/INST]