Basic sorting algorithms in Java.