Rather than doing set up before the loop and then getting more input in the loop you can shorten it with something like this

Java Code:

int n;
while((n=in.nextInt())!= 0){
//do stuff
}

What happens when you just pass the list into sort and shuffle? Look up what the reverseOrder method it. what does reversing the list imply? Some sort of sorting perhaps? What happens if you use it's comparator to sort a list?