title: How to select a object field for map value in Scala using groupby
body: <p>Here is a newbie scala question. I have a list of people with Person objects with <code>getName()</code> and <code>getYearOfBirth()</code> methods. I am using groupBy to group the Person objects but I only wish to put the 
  names into the map as Person will have lots of additional fields in future. The years will be the keys.</p>
  
  <pre><code>val people = List(
  Person("Tom", 1985),
  Person("Abigail", 1987),    
  Person("Joyce", 1984),
  Person("James", 1987),
  Person("Scott", 1985),  
  Person("Ruth", 1984)
  )
  
  
  var birthdayMap = people.groupBy(x=&gt; x.getYearOfBirth()) // map to getName() ?
  </code></pre>