/**
  * This method sorts the passed collection depending
  * on the comparator.
  *
  * @param \AppserverIo\Collections\CollectionInterface $collection Holds the Collection that should be sorted
  * @param \AppserverIo\Collections\ComparatorInterface $comperator The Comparator that should be used for compare purposes
  *
  * @return void
  */
 public static function sort(CollectionInterface $collection, ComparatorInterface $comperator)
 {
     // initialize the ArrayList that should be returned
     // sort the ArrayList
     $return = CollectionUtils::arraySort($collection->toArray(), 0, $collection->size(), $comperator);
     // clear all elements and add the sorted
     $collection->clear();
     $collection->addAll($return);
 }