private static <T extends Comparable<? super T>> T[] merge(T[] front, T[] rear) {
         T[] result = Arrays.copyOf(front, front.length + rear.length);
         
         int i = 0;
         int j = 0;
         int k = 0;
         for(; j < front.length && k < rear.length; i++) {
             T first = front[j];
             T second = rear[k];
             
             if (first.compareTo(second) < 0) {
                 result[i] = first;
                 j++;
             } else {
                 result[i] = second;
                 k++;
             }
         }
         
         T[] remainingData = (k == rear.length) ? front : rear;
         int value = (k == rear.length) ? j : k;
         
         for (int q = value; i < result.length; i++, q++)
             result[i] = remainingData[q];
         
         return result;
     }