Refactored JavaMergeSorter
Fixed bug in GroovyMergeSorter.