Java Sort Array Without Using Functional Grammar