code: public TupleTwo<TreeNode, TreeNode> anyNode(boolean bias, RandEngine randEngine)
     {
        List<TupleTwo<TreeNode, TreeNode>> nodes = flattenNodes();
        if (bias)
        {
           if (randEngine.uniform() <= 0.1) // As specified by Koza, 90% select function node, 10% select terminal node
           {
              List<TupleTwo<TreeNode, TreeNode>> terminal_nodes = new ArrayList<>();
              for (TupleTwo<TreeNode, TreeNode> tuple : nodes)
              {
                 TreeNode node = tuple._1();
                 if (node.isTerminal())
                 {
                    terminal_nodes.add(tuple);
                 }
              }
              if (terminal_nodes.size() > 0)
              {
                 return terminal_nodes.get(randEngine.nextInt(terminal_nodes.size()));
              }
              else
              {
                 return nodes.get(randEngine.nextInt(nodes.size()));
              }
           }
           else
           {
              List<TupleTwo<TreeNode, TreeNode>> function_nodes = new ArrayList<>();
              for (TupleTwo<TreeNode, TreeNode> tuple : nodes)
              {
                 TreeNode node = tuple._1();
                 if (!node.isTerminal())
                 {
                    function_nodes.add(tuple);
                 }
              }
              if (function_nodes.size() > 0)
              {
                 return function_nodes.get(randEngine.nextInt(function_nodes.size()));
              }
              else
              {
                 return nodes.get(randEngine.nextInt(nodes.size()));
              }
           }
        }
        else
        {
           return nodes.get(randEngine.nextInt(nodes.size()));
        }
  
     }
docs: / <returns></returns>