public static void merge_arrays(Integer[] a, Integer[] b) {
        Integer[] merge = new Integer[a.length + b.length];
        int i = 0, j = 0, k = 0;
        while (k < merge.length) {
            if (a[i] <= b[j]) {
                merge[k] = a[i++];
            } else {
                merge[k] = b[j++];
            }

            k++;

            if (i == a.length) {
                copyTail(b, j, merge, k);
                break;
            }

            if (j == b.length) {
                copyTail(a, i, merge, k);
                break;
            }
        }

        for (Integer value : merge) {
            System.out.print(value + " ");
        }
    }