Bubble sort implemented in Java.