GenotypeHelper { public static DerivationTree buildDerivationTree ( Individual individual, DerivationNode node ){ assert individual.getGenotype().get(0) instanceof GEChromosome : individual.getGenotype().get(0).getClass().getName(); assert individual.getMapper() instanceof GEGrammar : individual.getMapper().getClass().getName(); GEChromosome chromosome = (GEChromosome)individual.getGenotype().get(0); GEGrammar grammar = (GEGrammar)individual.getMapper(); if(node != null) grammar.setStartSymbol(node.getData()); grammar.getPhenotype().clear(); DerivationTree tree = TreeMill.getDerivationTree(grammar); if(tree.buildDerivationTree() == true) return tree; return null; } private  GenotypeHelper(); static DerivationTree buildDerivationTree(   Individual individual,
        DerivationNode node
    ); static DerivationTree buildDerivationTree(Individual individual); static DerivationNode findNodeFromCodonIndex(   DerivationTree tree,
        int codonIndex
    ); static DerivationNode findNodeFromCodonIndex(   DerivationTree tree,
        int codonIndex,
        int usedGenes
    ); static int calcNodeLength(DerivationNode nodes); static GEChromosome makeNewChromosome(   Individual i1,
        int point1,
        int length1,
        Individual i2,
        int point2,
        int length2
    ); static GEChromosome makeNewChromosome(   Individual i1,
        int point1,
        int length1,
        Individual i2,
        int point2,
        int length2,
        DerivationTree tree
    ); static GEChromosome makeNewChromosome(   Individual i1,
        int point,
        int length,
        Individual i2,
        DerivationTree tree
    );  }
@Test public void testBuildDerivationTree_Individual() { System.out.println("buildDerivationTree"); DerivationTree result = GenotypeHelper.buildDerivationTree(gei); assertEquals(true, result instanceof ContextualDerivationTree); result = GenotypeHelper.buildDerivationTree(gei2); assertEquals(true, result instanceof DerivationTree); }