Writing merge sort method using a comparator in Java?

I have been tasked to create a mergeSort method that uses a comparator. I have tried following code outlines yet I still can’t seem to get it to work. I realize that there is an issue with the indices in the code, but I’m not sure how to fix it.

Here is the code that I am using:

public static <T> void mergeSort(List<T> list, Comparator<T> c) {
    mergeSort(list, 0, list.size(), c);

private static <T> void mergeSort(List<T> list, int begin,
        int end, Comparator<T> c) {
    ArrayList<T> elements = new ArrayList<T>();

    for (int i = begin; i <= end; i++) {
        if (c.compare(list.get(i), list.get(i + 1)) < 0
                || c.compare(list.get(i), list.get(i + 1)) == 0) {
        } else {

    copy(list, elements, begin, end);

private static <T> void copy(List<T> original, List<T> newList,
        int begin, int end) {
    for (int i = begin; i <= end; i++) {
        original.set(i, newList.get(i));

Any feedback is appreciated.
Thank you.