title: Is there any reason for "Boolean.TRUE.equals(x)" in Java?
body: <p>I've come across this code in one of the projects I'm working on</p>
  
  <p>(This is in Java)</p>
  
  <pre><code>if (Boolean.TRUE.equals(foo.isBar()))
  </code></pre>
  
  <p><strong>Foo#isBar()</strong> is defined as <code>boolean isBar()</code>, so it can't return <code>null</code></p>
  
  <p>Is there really any reason why it should be written that way?
  I myself would just write</p>
  
  <pre><code>if (foo.isBar())
  </code></pre>
  
  <p>, but perhaps I'm missing something subtle.</p>
  
  <p>Thanks</p>