code: public GeneticAlgorithm<T> setElitism(int elitism) {
          if (elitism < 0 || elitism >= size) {
              throw new IllegalArgumentException("Invalid elitism: " + elitism);
          }
          this.elitism = elitism;
          return this;
      }
docs: Sets the number of best chromosomes to copy to new population. Sets the
  value to zero to disable elitism selection. When creating new population
  by crossover and mutation, we have a big chance, that we will loose the
  best chromosome. Elitism first copies the best chromosome (or a few best
  chromosomes) to new population. The rest is done in classical way.
  Elitism can very rapidly increase performance of GA, because it prevents
  losing the best found solution.