title: if-else logic issue in java 8 stream for filter
body: <p>Question:</p>
  <p>Give a <code>ArrayList</code> of <code>Player</code>s -  <code>List&lt;Player&gt;</code>. Take a <code>Player</code> POJO with <code>String Name</code>, <code>int age</code>, and <code>int runs</code>. Build a list using <code>list.add</code>.</p>
  <p>Find the first player whose age is less than 30 and Runs greater than 5000 and print the name. or else print &quot;No player selected for world cup&quot;</p>
  <p>POJO class:</p>
  <pre class="lang-java prettyprint-override"><code>public class Player {
      String name;
      int age;
      int runs;
      
      public Player(String name, int age, int runs) {
          super();
          this.name = name;
          this.age = age;
          this.runs = runs;
      }
      
      @Override
      public String toString() {
          return &quot;Player [name=&quot; + name + &quot;]&quot;;
      }
  }
  </code></pre>
  <p>Logic:</p>
  <pre class="lang-java prettyprint-override"><code>List&lt;Player&gt; players = Arrays.asList(
      new Player(&quot;Sachin&quot;,45,10252),
      new Player(&quot;Virat&quot;,29,7000),
      new Player(&quot;Dhoni&quot;,38,4000),
      new Player(&quot;Yuvraj&quot;,29,5500)
  );
  
  List&lt;Player&gt; filtered = players.stream()
      .filter(i -&gt; i.runs &gt; 5000 &amp;&amp; i.age &gt; 50)
      .collect(Collectors.toList());
  
  if(filtered == null) {
      System.out.println(&quot;No Player selected for World Cup&quot;);
  } else {
      System.out.println(filtered);
  }
  </code></pre>
  <p>here the if part is not executing, else is running fine for valid conditions</p>