title: Groovy method to get a random element from a list
body: <p>Groovy is extremely powerful managing collections. I have a list like this one:</p>
  
  <pre><code>def nameList = ["Jon", "Mike", "Alexia"]
  </code></pre>
  
  <p>What I am trying to do is iterating 10 times to get ten people with a random name from the first list.</p>
  
  <pre><code>10.times{
      Person person = new Person(
      name: nameList.get() //I WANT TO GET A RANDOM NAME FROM THE LIST
      )
  }
  </code></pre>
  
  <p>This is not working for two obvious reasons, I am not adding any index in my nameList.get and I am not creating 10 different Person objects.</p>
  
  <ol>
  <li>How can I get a random element from my name list using groovy?</li>
  <li>Can I create a list with 10 people with random names (in a simple way), using groovy's collections properties?</li>
  </ol>