title: Use of Boolean? in if expression
body: <p>If I have a nullable <code>Boolean b</code>, I can do the following comparison in Java:</p>
  
  <pre><code>Boolean b = ...;
  if (b != null &amp;&amp; b) {
     /* Do something */
  } else {
     /* Do something else */
  }
  </code></pre>
  
  <p>In Kotlin, I can achieve the same by using the <code>!!</code> operator:</p>
  
  <pre><code>val b: Boolean? = ...
  if (b != null &amp;&amp; b!!) {
     /* Do something */
  } else {
     /* Do something else */
  }
  </code></pre>
  
  <p>However, the use of <code>!!</code> feels a bit sketchy to me, circumventing the null safety system.</p>
  
  <p>Is there a more elegant approach for this?</p>
  
  <hr>
  
  <p><em>Edit</em> It seems I oversimplicated a bit. For local variables, as <a href="https://stackoverflow.com/a/32831059/675383">Banthar</a> shows, it does work. However, my Boolean <code>b</code> is actually a "property with a backing field" (I'm not really up to speed yet what this imposes). This is the result:</p>
  
  <p><a href="https://i.stack.imgur.com/19xYe.png" rel="noreferrer"><img src="https://i.stack.imgur.com/19xYe.png" alt="enter image description here"></a></p>