title: How to use if else statement with Groovy?
body: <p>i'm using a Groovy step with Soapui.
  The following code is working well but it seems to be long and repetitive:</p>
  
  <pre><code>if(response.comp.type[3] == "value1")
  log.info ("value1 is present")
  else
  log.info ("value1 is not present")
  
  if(response.comp.bucket[3] == null)
  log.info ("bucket = null")
  else
  log.info ("bucket is not null")
  
  if(response.comp.cycle[3] == "new")
  log.info ("settings cycle = new")
  else
  log.info ("settings cycle is null")
  </code></pre>
  
  <p>Is it possible to do the same in one test instead of repeating the IF and ELSE on each line.
  i tried with TRY CATCH but i cannot have the stack trace of the error.</p>
  
  <p>Can anyone help to reduce the code.
  Thank you</p>