Completed merge sort in Java.