title: Groovy - condense multiple if statements
body: <p>I'm a groovy newbie so bear with me here. I love groovy's power to write less and often cleaner code but I'm trying to figure out if there's a better or more readable way of condensing these multiple if statements. It's a fairly straightforward code snippet but there's got to be a better way of doing this. I'm a newbie so any code snippets are greatly appreciated.</p>
  
  <pre><code>if (!textOverlay) {
    textType = "" 
    if(url != null){
      Page getPage = resource.getResourceResolver().getResource(url).adaptTo(Page.class)
      if (getPage != null) {
        showLink = showLink + ".html"
          if (fragment.length() &gt; 0) {
            url += "#"+fragment;
          }
      }
    }             
  }  else { 
      //do something else
  }
  </code></pre>
  
  <p>Thanks in advance for the help!</p>