Implemented Mergesort in Java and Groovy