@Test
// test if selects correct number and order of individuals
public void testSelect1() throws Exception{

    SimplePopulation popIn = new SimplePopulation();
    Individual[] individuals = new SimpleIndividual[5];
    for (int i = 0; i < individuals.length; i++){
        individuals[i] = new SimpleIndividual(0, 0.0, new SimplePhenotypeRepresentation());
        individuals[i].setFitness((i-1)*(i-1)); // shifted parabola with prescription y = x^2 and bottom at position (x = -1). 
    }
    popIn.setIndividuals(individuals);
    this.operator.setInputArity(1);
    this.operator.setOutputArity(1);
    this.operator.setIndividualsPerPopulation(5);
    Population[] popsOut = this.operator.select(new SimplePopulation[]{popIn});
    Individual ind = popsOut[0].getIndividuals()[0];
    assertTrue(ind.getFitness() == 9.0);
    ind = popsOut[0].getIndividuals()[1];
    assertTrue(ind.getFitness() == 4.0);
    ind = popsOut[0].getIndividuals()[2];
    assertTrue(ind.getFitness() == 1.0);
    ind = popsOut[0].getIndividuals()[3];
    assertTrue(ind.getFitness() == 1.0);
    ind = popsOut[0].getIndividuals()[4];
    assertTrue(ind.getFitness() == 0.0);
}