code: public GeneticAlgorithm<T> setTournament(int size, double p) {
          if (size < 1) {
              throw new IllegalArgumentException("Invalid tournament size: " + size);
          }
          
          if (p < 0.5 || p > 1.0) {
              throw new IllegalArgumentException("Invalid best-player-wins probability: " + p);
          }
          
          tournamentSize = size;
          tournamentProbability = p;
          return this;
      }
docs: Set the tournament size and the best-player-wins probability in
  tournament selection.
  @param size the size of tournament pool.
  @param p the best-player-wins probability.