GrowInitialiser implements CreationOperation, Stochastic { @SuppressWarnings({"BooleanMethodIsAlwaysInverted"}) protected boolean checkGECodonValue(NimbleTree<Symbol> dt) { boolean ret = false; if (dt.getCurrentNode().getData().getSymbolString().contains(Constants.GE_CODON_VALUE)) { this.chromosome.add(this.rng.nextInt(Integer.MAX_VALUE)); ret = true; } return ret; } GrowInitialiser(RandomNumberGenerator rng, GEGrammar gegrammar, int maxDepth);  GrowInitialiser(RandomNumberGenerator rng, GEGrammar gegrammar, Properties p); void setRNG(RandomNumberGenerator m); RandomNumberGenerator getRNG(); void setProperties(Properties p); Individual createIndividual(); int getMinDepth(); void setMinDepth(int minDepth); void setMaxDepth(int i); int getMaxDepth(); void doOperation(Individual operand); void doOperation(List<Individual> operands); Genotype getGenotype(int maxLength); boolean grow(NimbleTree<Symbol> dt);  }
@Test public void testCheckGECodonValue() { System.out.println("checkGECodonValue"); NimbleTree<Symbol> dt = new NimbleTree<Symbol>(); TreeNode<Symbol> tn = new TreeNode<Symbol>(); tn.setData(new Symbol((String) Constants.GE_CODON_VALUE,Enums.SymbolType.NTSymbol)); dt.populateStack(); dt.setRoot(tn); dt.setCurrentNode(dt.getRoot()); boolean expResult = true; gi3.genotype = new Genotype(); gi3.chromosome = new GEChromosome(10); gi3.chromosome.setMaxChromosomeLength(100); gi3.genotype.add(gi3.chromosome); boolean result = gi3.checkGECodonValue(dt); System.out.println("the tree is: " + dt.toString()); assertEquals(expResult, result); }