title: How to avoid "NullPointerException" when using "isEmpty()" for null Objects
body: <p>i'm using An Object named bean with a property named val of type String.</p>
  
  <p>I'm looking for a way to check if my String value isEmpty and avoid a Null PointerException.</p>
  
  <pre><code>if (bean.getVal().isEmpty())) { // check if my value has some text.
  // do some stuff.
  }
  </code></pre>
  
  <p>I hope to get the proper way to solve this issue.</p>