@Test
// tests concatenation and ordering of given Populations, limited by maxIndexExclusive
public void testConcatenate2() throws Exception {

    SimpleIndividual[] ind1 = new SimpleIndividual[] {new SimpleIndividual(1, 1.0, null), new SimpleIndividual(2, 3.0, null), new SimpleIndividual(5, 3.0, null)};
    SimpleIndividual[] ind2 = new SimpleIndividual[] {new SimpleIndividual(10, 0.0, null), new SimpleIndividual(2, 2.0, null)};
    Individual[] indOut = PopulationUtils.concatenate(new Population[]{new SimplePopulation(ind1), new SimplePopulation(ind2), new SimplePopulation(ind1)}, new SimplePopulationFactory(), 2).getIndividuals();
    assertTrue(indOut[0] == ind1[0]);
    assertTrue(indOut[1] == ind1[1]);
    assertTrue(indOut[2] == ind1[2]);
    assertTrue(indOut[3] == ind2[0]);
    assertTrue(indOut[4] == ind2[1]);
    assertTrue(indOut.length == ind1.length + ind2.length);
}