AbstractArchive extends Archive { @Override public boolean update(Set<? extends Individual> individuals) { List<Individual> candidates = new ArrayList<>(individuals); candidates.removeAll(this); removeDominatedCandidates(candidates); removeArchiveDominated(candidates); return updateWithNondominated(candidates); }  @Override boolean update(Set<? extends Individual> individuals);  }
@Test public void update() { Injector injector = Guice.createInjector(new MockProblemModule()); IndividualFactory factory = injector.getInstance(IndividualFactory.class); Objective o0 = new Objective("o0"); Objective o1 = new Objective("o1"); TestArchive archive = new TestArchive(); Individual i0 = factory.create(); Objectives objectives0 = new Objectives(); objectives0.add(o0, 1); objectives0.add(o1, 0); i0.setObjectives(objectives0); Assert.assertTrue(archive.update(i0)); Assert.assertTrue(archive.contains(i0)); }