Merge sort implementation in Java