Java implementation of common sorting algorithms