code: public static void apply(Program program, TreeGP manager)
     {
        RandEngine randEngine = manager.getRandEngine();
        TreeNode node = program.anyNode(randEngine)._1();
  
        if (node.isTerminal())
        {
           Primitive terminal = program.anyTerminal(randEngine);
           int trials = 0;
           int max_trials = 50;
           while (node.getPrimitive() == terminal)
           {
              terminal = program.anyTerminal(randEngine);
              trials++;
              if (trials > max_trials) break;
           }
           if (terminal != null)
           {
              node.setPrimitive(terminal);
           }
  
        }
        else
        {
           int parameter_count = node.arity();
           Primitive op = program.getOperatorSet().anyOther(parameter_count, node.getPrimitive(), randEngine);
           if (op != null)
           {
              node.setPrimitive(op);
           }
  
        }
     }
docs: / </summary>