title: Filter an Optional<List<Object>> in java8
body: <p>I am trying to Filter an <code>Optional&lt;List&lt;Object&gt;&gt;</code> in Java8. In the below example, I trying to filter the list, without collecting the full list (players). Is this possible? </p>
  
  <pre><code>public List&lt;Player&gt; getPlayers(int age, Team team) {
      Optional.ofNullable(team).map(Team::getPlayers); 
      // needs to filter players older than 20 years, without collecting it as a list.
  }
  
  class Team {
  
      String name;
      List&lt;Player&gt; players;
      public String getName() {
          return name;
      }
  
      public void setName(final String name) {
          this.name = name;
      }
  
      public List&lt;Player&gt; getPlayers() {
          return players;
      }
  
      public void setPlayers(final List&lt;Player&gt; players) {
          this.players = players;
      }
  
  }
  
  
  class Player {
  
      String playerName;
      String age;
  
      public String getPlayerName() {
          return playerName;
      }
  
      public void setPlayerName(final String playerName) {
          this.playerName = playerName;
      }
  
      public String getAge() {
          return age;
      }
  
      public void setAge(final String age) {
          this.age = age;
      }
  }
  </code></pre>