Basic sorting algorithms implementations in Java