private Collection<CollisionJobContext> sortJobs(Collection<CollisionJobContext> waitJobs,int waitSize){
  List<CollisionJobContext> passiveList=new ArrayList<>(waitJobs.size());
  int i=0;
  for (  CollisionJobContext waitJob : waitJobs) {
    passiveList.add(waitJob);
    if (i++ == waitSize)     break;
  }
  Collections.sort(passiveList,comparator());
  return passiveList;
}

private Collection < CollisionJobContext > sortJobs ( Collection < CollisionJobContext > waitJobs , int waitSize ) { List < CollisionJobContext > passiveList = new ArrayList < > ( waitJobs . size ( ) ) ; int i = 0 ; for ( CollisionJobContext waitJob : waitJobs ) { passiveList . add ( waitJob ) ; if ( i ++ == waitSize ) break ; } Collections . sort ( passiveList , comparator ( ) ) ; return passiveList ; }
sort jobs by priority from high to lowest value .
