Java comparator sort implementation. Benchmarks and unit tests are included.