Example Sort Algorithm write in Java