I have a List of doubles in java and I want to sort ArrayList in descending order.
Input ArrayList is as below:
List testList = new Arr
If you have to sort object based on its id in the ArrayList , then use java8 stream.
List personList = new ArrayList<>(); List personListSorted = personList.stream() .sorted(Comparator.comparing(Person::getPersonId)) .collect(Collectors.toList());