@Test public void createWithGenotypeTest() { AbstractIndividualFactory<Individual> factory = getFactory(); init(factory); Genotype genotype = new PermutationGenotype<Object>(); Individual individual = factory.create(genotype); Assert.assertTrue(individual.individualStateListeners.contains(listener)); Assert.assertTrue(individual.genotype == genotype); }
@Override public Individual create() { Individual individual = individualProvider.get(); individual.setIndividualStatusListeners(individualStateListeners); Genotype genotype = creator.create(); individual.setGenotype(genotype); return individual; }
AbstractIndividualFactory implements IndividualFactory { @Override public Individual create() { Individual individual = individualProvider.get(); individual.setIndividualStatusListeners(individualStateListeners); Genotype genotype = creator.create(); individual.setGenotype(genotype); return individual; } }
AbstractIndividualFactory implements IndividualFactory { @Override public Individual create() { Individual individual = individualProvider.get(); individual.setIndividualStatusListeners(individualStateListeners); Genotype genotype = creator.create(); individual.setGenotype(genotype); return individual; } AbstractIndividualFactory(Provider<I> individualProvider, Creator<Genotype> creator); }
AbstractIndividualFactory implements IndividualFactory { @Override public Individual create() { Individual individual = individualProvider.get(); individual.setIndividualStatusListeners(individualStateListeners); Genotype genotype = creator.create(); individual.setGenotype(genotype); return individual; } AbstractIndividualFactory(Provider<I> individualProvider, Creator<Genotype> creator); @Override void addIndividualStateListener(IndividualStateListener listener); @Override Individual create(); @Override Individual create(Genotype genotype); @Override void removeIndividualStateListener(IndividualStateListener listener); }
AbstractIndividualFactory implements IndividualFactory { @Override public Individual create() { Individual individual = individualProvider.get(); individual.setIndividualStatusListeners(individualStateListeners); Genotype genotype = creator.create(); individual.setGenotype(genotype); return individual; } AbstractIndividualFactory(Provider<I> individualProvider, Creator<Genotype> creator); @Override void addIndividualStateListener(IndividualStateListener listener); @Override Individual create(); @Override Individual create(Genotype genotype); @Override void removeIndividualStateListener(IndividualStateListener listener);  }