title: How to sort a list by existing properties
body: <p>I am using this line here to sort a list based on the object's name.</p>
  
  <pre><code>g.V.sort{it.name}
  </code></pre>
  
  <p>How do I sort it based on "name" if it exists, if not, I wanna sort it by "title". If both exist I want to first sort by "name" and then by "title".</p>
  
  <p>I'm not a Groovy coder so thanks for the help in advance.</p>