title: Groovy: how to test if a property access will be successful?
body: <p>I have a variable Object foo, which is not null. I want to use foo.bar, but only if it won't bomb me with 'No such property: bar for class: Whatever'. </p>
  
  <p>How should I do the following test:</p>
  
  <pre><code>if (/*test-here*/) {
    use(foo.bar)
  }
  </code></pre>