SortedArrayList è un ArrayList che ricorda come esso è ordinato, in modo che se chiedete a ordinare, a volte può…