question: private < T > List < T > toSortedList ( T [ ] array , Comparator < T > comparator ) { List < T > list = new ArrayList < > ( ) ; Collections . addAll ( list , array ) ; Collections . sort ( list , comparator ) ; return list ; }
target:  Creates a sorted list from an array of elements using the given classComparator.