static void merge(int[] leftArray, int[] rightArray, int[] newArray) {
    int i = 0, j = 0, k = 0;
    int leftLength = leftArray.length;
    int rightLength = rightArray.length;

    // Compare left and right and put the smaller value in the new array
    while(i < leftLength && j < rightLength) {
      if(leftArray[i] <= rightArray[j]) {
        newArray[k] = leftArray[i];
        i++;
      }
      else {
        newArray[k] = rightArray[j];
        j++;
      }
      k++;
    }

    // Work on the remaining elements on the left or right
    while(i < leftLength) {
      newArray[k] = leftArray[i];
      i++;
      k++;
    }
    while(j < rightLength) {
      newArray[k] = rightArray[j];
      j++;
      k++;
    }
    System.out.println("=====================Sorting Complete=================");
    for(int element : newArray) {
      System.out.println(element);
    }
  }