title: Avoid nested if for null and parameter condition
body: <p>Is it possible to avoid nested <code>if</code> statements while I want to check if variable/object is <code>null</code> and if variable/object meet some condition eg.</p>
  
  <pre><code>var obj = "test";
  if (obj != null) {
     if (obj.equals("test")) {
        //do something;
     }
  }
  </code></pre>
  
  <p>Is it possible to do oneliner of this statement without defining own method which handle this ?</p>