code: public static <T> ArrayList<T> sortThis(ArrayList<T> list, Comparator<? super T> comparator)
      {
          int size = list.size();
          if (ArrayListIterate.canAccessInternalArray(list))
          {
              Arrays.sort(ArrayListIterate.getInternalArray(list), 0, size, comparator);
          }
          else
          {
              Collections.sort(list, comparator);
          }
          return list;
      }
docs: Mutates the internal array of the ArrayList by sorting it and then returns the same ArrayList.