@Test
public void testEvaluate3() throws Exception {

    DeJongParabolaFunction function = new DeJongParabolaFunction();
    Function functionWrapper = new FunctionWrapper(function, 6);
    function.setDimension(2);
    function.setOffset(0.0);
    function.setInverted(false);
    SimpleIndividual ind1 = new SimpleIndividual(1, 0.0, new SimplePhenotypeRepresentation(new double[]{1.0, 2.0}));
    SimpleIndividual ind2 = new SimpleIndividual(1, 0.0, new SimplePhenotypeRepresentation(new double[]{-2.0, 2.0}));
    SimpleIndividual ind3 = new SimpleIndividual(1, 0.0, new SimplePhenotypeRepresentation(new double[]{-3.0, -2.0}));
    SimpleIndividual ind4 = new SimpleIndividual(1, 0.0, new SimplePhenotypeRepresentation(new double[]{1.0, -3.0}));
    SimpleIndividual ind5 = new SimpleIndividual(1, 0.0, new SimplePhenotypeRepresentation(new double[]{2.0, -1.0}));
    SimpleIndividual ind6 = new SimpleIndividual(1, 0.0, new SimplePhenotypeRepresentation(new double[]{4.0, 3.0}));
    ind1.setValue(0.0); ind2.setValue(0.0); ind3.setValue(0.0); ind4.setValue(0.0); ind5.setValue(0.0); ind6.setValue(0.0);
    Individual[] individuals1 = new Individual[]{ind1, ind2};
    Individual[] individuals2 = new Individual[]{ind3};
    Individual[] individuals3 = new Individual[]{ind4, ind5, ind6};
    Population[] populations = new Population[]{new SimplePopulation(individuals1), new SimplePopulation(individuals2), new SimplePopulation(individuals3)};
    ParallelFunctionEvaluator evaluator = new ParallelFunctionEvaluator(5);
    evaluator.evaluate(populations, functionWrapper);
    assertEquals(5.0, ind1.getValue(), 0.0);
    assertEquals(8.0, ind2.getValue(), 0.0);
    assertEquals(13.0, ind3.getValue(), 0.0);
    assertEquals(10.0, ind4.getValue(), 0.0);
    assertEquals(5.0, ind5.getValue(), 0.0);
    assertEquals(25.0, ind6.getValue(), 0.0);
}