title: If condition in lambda expression to change value in java
body: <p>This is a code snippet that I want to modify.</p>
  <pre class="lang-java prettyprint-override"><code>fullAlert.getSupportingData().forEach( data -&gt;      
      dataMap.put(data.getKey(), data.getValue())
  );
  </code></pre>
  <p>I want to check if <code>data.getValue()</code> does return <strong>empty or null</strong>.
  If so then</p>
  <pre><code>dataMap.put(data.getKey(), data.getValue())
  </code></pre>
  <p>Else I want to replace backslashes</p>
  <pre><code>dataMap.put(data.getKey(), data.getValue().replace(&quot;\\&quot;,&quot;\\\\&quot;))
  </code></pre>
  <p>I am new to lambda expressions.</p>