Score: 0.9/1.0

import java.util.*;
import java.lang.Math;  

ArrayList<Integer> number = new ArrayList<Integer>();
ArrayList<Integer> number2 = new ArrayList<Integer>();
for (int i = 0; i < 5; i++){
    number.add(i);
}
for (int i = 5; i > 0; i--){
    number.add(i);
}
System.out.println("Original: " +number);
System.out.println("HashCode: " + number.hashCode());
number.sort(Comparator.reverseOrder());
System.out.println("ArrayList after sort: " + number);
System.out.println("HashCode: " + number.hashCode());
Collections.swap(number, 4, 0);
System.out.println("Swap the first and last elements: " + number);
System.out.println("HashCode: " + number.hashCode());
boolean a;
boolean b;
for (int i=0; i < number.size() - 1; i++){
    if (!(number.get(i) <= number.get(i + 1))){
        boolean a = false;
    }
    if (!(number.get(i) >= number.get(i + 1))){
        boolean b = false;
    }
}
if (a){
    System.out.println("ascending");
}
if (b){
    System.out.println("descending");
}
else{
    System.out.println("neither");
}
Original: [0, 1, 2, 3, 4, 5, 4, 3, 2, 1]
HashCode: -1631985086
ArrayList after sort: [5, 4, 4, 3, 3, 2, 2, 1, 1, 0]
HashCode: -287789284
Swap the first and last elements: [3, 4, 4, 3, 5, 2, 2, 1, 1, 0]
HashCode: 162496028
neither