title: Filter a list property of a list of objects in scala
body: <p>I am trying trying to filter a list property of a list of objects in scala. For example:</p>
  
  <p>Class defined in java</p>
  
  <pre><code>public class Result{
      private Collection&lt;Person&gt; persons= new ArrayList();
      public Collection&lt;Person&gt; getPersons() {return this.persons;}
  }
  
  public class Person{
      public String name
  }
  </code></pre>
  
  <p>My filter function is returning a list of String instead of a list of Result</p>
  
  <pre><code>val listOfResutlts = Seq.empty[Result]  // imagine this was filled with a bunch of Result objects
  
  listOfResutlts.map(
      result =&gt; result.getPersons.filter(person =&gt; person.name=="xx")
  )
  </code></pre>
  
  <p><strong>UPDATE</strong>
  I want to get back all the results in the listOfResults with the names properpty of each Result being filtered.</p>