code: public static <S> void fillPopulationWithNewSolutions(
        List<S> solutionList,
        Problem<S> problem,
        int maxListSize) {
      while (solutionList.size() < maxListSize) {
        solutionList.add(problem.createSolution());
      }
    }
docs: Fills a population with new solutions until its size is maxListSize
  
  @param solutionList The list of solutions
  @param problem      The problem being solved
  @param maxListSize  The target size of the list
  @param <S>          The type of the solutions to be created