@Test
// tests selection of less Individuals than given from two Populations
public void testSelect2() throws Exception {

    SimplePopulation popIn1 = new SimplePopulation();
    SimplePopulation popIn2 = new SimplePopulation();
    Individual[] individuals1 = new SimpleIndividual[2];
    for (int i = 0; i < individuals1.length; i++){
        individuals1[i] = new SimpleIndividual(0, 0.0, new SimplePhenotypeRepresentation());
        individuals1[i].setFitness((i-1)*(i-1)); // shifted parabola with prescription y = x^2 and bottom at position (x = -1).
    }
    Individual[] individuals2 = new SimpleIndividual[2];
    for (int i = 0; i < individuals2.length; i++){
        individuals2[i] = new SimpleIndividual(0, 0.0, new SimplePhenotypeRepresentation());
        individuals2[i].setFitness((i-1)*(i-1)); // shifted parabola with prescription y = x^2 and bottom at position (x = -1).
    }
    popIn1.setIndividuals(individuals1);
    popIn2.setIndividuals(individuals2);
    this.operator.setInputArity(2);
    this.operator.setOutputArity(1);
    this.operator.setIndividualsPerPopulation(2);
    Population[] popsOut = this.operator.select(new SimplePopulation[]{popIn1, popIn2});
    assertTrue(popsOut.length == 1);
    assertTrue(popsOut[0].getIndividuals().length == 2);
    for (Individual ind : popsOut[0].getIndividuals()){
        assertTrue(ind != null);
    }
}