title: JAVA Querying the list of data using Stream filter,null pointer exception
body: <pre><code>List&lt;Data&gt;data = Datalist.stream()
  .filter(o -&gt; o.getX().equals(data.getX()) &amp;&amp; 
    o.getY().equals(data.getMwSchemeCode().getY()) &amp;&amp; 
    o.getZ().equals(o.getZ()))
  .collect(Collectors.toList);
  </code></pre>
  
  <p>When I run this code a Null pointer exception occurs.
  I already tried to check the stream entity for null, though it didn't work.</p>