code: public Terminal anyTerminal(RandEngine randEngine)
     {
        int variable_count = variableSet.size();
        int constant_count = constantSet.size();
        int r = randEngine.nextInt(variable_count + constant_count);
        if (r < variable_count)
        {
           return (Terminal)variableSet.get(r);
        }
        else
        {
           return (Terminal)constantSet.get(r - variable_count);
        }
     }
docs: / <returns>The randomly selected terminal primitive</returns>