If you have to sort object based on its id in the ArrayList , then use java8 stream.
List<Person> personList = new ArrayList<>();
List<Person> personListSorted =
personList.stream()
.sorted(Comparator.comparing(Person::getPersonId))
.collect(Collectors.toList());