Ho do I mock external functions used in recursive functions?

Viewed 181

Take this function for example:

public static int[] mergeSort(int[] array, int lo, int hi) {
        if (lo == hi) {
            return array;
        }
    int mid = (lo + hi) / 2;
    mergeSort(array, lo, mid);
    mergeSort(array, mid, hi);
    merge(array, lo, mid + 1, hi);

    return array;
}

As you can see there is the function merge which I want to mock in my test. It is possible?

2 Answers
Related