@Override public List<Node> generate(int popSize){
  List<Node> population=new ArrayList<>();
  for (int i=0; i < popSize; ) {
    Node candidate=full(1);
    if (candidate.isValid()) {
      population.add(candidate);
      i++;
    }
  }
  return population;
}

@ Override public List < Node > generate ( int popSize ) { List < Node > population = new ArrayList < > ( ) ; for ( int i = 0 ; i < popSize ; ) { Node candidate = full ( 1 ) ; if ( candidate . isValid ( ) ) { population . add ( candidate ) ; i ++ ; } } return population ; }
this method returns a new population of the desired size . the population is generated by full algorithm which creates individual with a fixed depth
