SimplePopulation implements Population { public void sort() { Collections.sort(indies); } SimplePopulation();  SimplePopulation(int size); void add(Individual i); void sort(); Iterator<Individual> iterator(); int size(); void addAll(Collection<Individual> immigrants); void addAll(Population immigrants); List<Individual> getAll(); boolean contains(AbstractIndividual individual); @Override String toString(); boolean contains(Individual individual); Individual get(int index); void clear(); void remove(Individual ind); Individual set(int i, Individual ind);  }
@Test public void testSort() { System.out.println("*SimplePopulationTest: sort"); double[] expected = new double[population.size()]; for (int i = 0; i < expected.length; i++) { expected[i] = i + 1; } population.sort(); for (int i = 0; i < population.size(); i++) { assertEquals(population.get(i).getFitness().getDouble(), expected[i], 0.00001); } }