public long[] merge(long[] src1, long[] src2) {
        long[] dest = new long[src1.length + src2.length];
        int i = 0, j = 0, k;

        for (k = 0; k < dest.length; k++) {
            if (i < src1.length && j < src2.length) {
                if (src1[i] <= src2[j])
                    dest[k] = src1[i++];
                else
                    dest[k] = src2[j++];
            } else if (i == src1.length && j < src2.length)
                dest[k] = src2[j++];
            else if (i < src1.length && j == src2.length)
                dest[k] = src1[i++];
        }
        return dest;
    }