<p>Merging collapsible <code>if</code> statements increases the code's readability.</p>

<h2>Noncompliant Code Example</h2>

<pre>
if (file != null) {
  if (file.isFile() || file.isDirectory()) {
    /* ... */
  }
}
</pre>
<h2>Compliant Solution</h2>

<pre>
if (file != null && isFileOrDirectory(file)) { 
  /* ... */
}

private static boolean isFileOrDirectory(File file) {
  return file.isFile() || file.isDirectory();
}
</pre>