GEIndividual extends AbstractIndividual { public static GEIndividual getIndividual(final GEGrammar grammar, final Phenotype phen, final Genotype genotype, final Fitness fitness) { final GEIndividual gei; if(grammar instanceof GEGrammar) { gei = new GEIndividual(grammar, phen, genotype, fitness); } else { throw new IllegalArgumentException(grammar+" is not GEGrammar"); } return gei; } GEIndividual();  GEIndividual(GEGrammar g, Phenotype p, Genotype gen, Fitness f); private  GEIndividual(GEIndividual i); static GEIndividual getIndividual(final GEGrammar grammar, final Phenotype phen, final Genotype genotype, final Fitness fitness); void revalidate(GEIndividual ind); void invalidate(); boolean isMapped(); void setMapped(boolean mapped); boolean isValid(); void setValid(boolean b); boolean wasPreviouslyValid(); void setUsedCodons(int usedCodons); void setUsedWraps(int usedWraps); void map(int map); String getPhenotypeString(int map); Genotype getGenotype(); Mapper getMapper(); void setMapper(Mapper m); void setGenotype(Genotype g); void setPhenotype(Phenotype p); Phenotype getPhenotype(); Individual clone(); @Override String toString(); int getUsedCodons(); void setPreviouslyUsedCodons(int previouslyUsedCodons); int getPreviouslyUsedCodons(); int getUsedWraps(); int[] getCrossoverPoints(); int[] getMutationPoints(); ArrayList<Fitness> getParents(); void setCrossoverPoints(int[] crossoverPoints); void setMutationPoints(int[] mutationPoints); void setParents(ArrayList<Fitness> parents);  }
@Test public void testGetIndividual() { System.out.println("* GEIndividualTest: getIndividual"); GEGrammar geg = new GEGrammar(); Phenotype p = new Phenotype(); int[] ia2 = {0}; Genotype geno2 = new Genotype(); geno2.add(new GEChromosome(1, ia2)); Fitness f = new BasicFitness(); GEIndividual gei2 = GEIndividual.getIndividual(geg, p, geno2, f); assertEquals(true, gei2.getMapper() instanceof GEGrammar); }