Mergesort implementation in Java