title: How to set null value if String is empty?
body: <p>Sometimes developers checks if <em>Strings</em> are <em>null</em> values, if yes, sets those Strings as empty value:</p>
  
  <pre><code>if (text == null) {
      text = "";
  }
  </code></pre>
  
  <p>What I want to do is to write opposite <em>if</em> statement:</p>
  
  <pre><code>if (text.isEmpty()) {
      text = null;
  }
  </code></pre>
  
  <p>But...first of all - I have to check (as usually) if this String is null to avoid NullPointerException, so right now it looks like this (very ugly but KISS):</p>
  
  <pre><code>if (!text == null) {
      if (text.isEmpty()) {
          text = null;
      }
  }
  </code></pre>
  
  <p>My class has several String fields and for all of them I have to prepare this solution.
  Any basic ideas for more efficient code? Is it a good way to strech it to lambda expressions and iterate throught all String fields in this class?</p>