Counting Sort implemented in Java