Java implementation of the bubble sort algorithm.