public void truncate(int size,Comparator<? super Solution> comparator){
  sort(comparator);
  while (data.size() > size) {
    data.remove(data.size() - 1);
  }
}

public void truncate ( int size , Comparator < ? super Solution > comparator ) { sort ( comparator ) ; while ( data . size ( ) > size ) { data . remove ( data . size ( ) - 1 ) ; } }
sorts this population using the specified comparator and removes the last ( maximum ) solutions until this population ' s size is within the specified size .
