title: Storing values with duplicate keys in TreeMap, HashMap, or LinkedHashMap
body: <p>I am currently working on a project in which I am retrieving data about names from the Social Security website.  Basically I'm given a number x, and years y and z.  I have to return the top x names from each of the years y through z.</p>
  
  <p>So the data returned from the website is a name, a rank, and a year.  I have to enter each name returned into either a TreeMap, HashMap, or LinkedHashMap, but I'm not sure how to store them, because no matter what I use as the key, there might be duplicates.  The year cannot be the key as I will have the top x names from each year, so they would all be from the same year.  If there are multiple years, there would be several names of rank 1, etc, as there is one for each year, so that could not be the key.  And the name itself could not be the key as the same name might have been in the top several names for multiple years.</p>
  
  <p>I've managed to understand most of the complicated parts of this project, yet this--one of the simplest parts, I can't seem to understand!</p>
  
  <p>I've heard of ways that I can use something like the year as the key and make the value a list of names or something similar, but I'm not sure how I would add values in implementations like that.  I would greatly appreciate any recommendations!</p>
  
  <p>Thanks so much.</p>
  
  <p>Edit: Please note that I was specifically told I MUST use TreeMap, HashMap, or LinkedHashMap.  I've heard of MultiMap but that's not one of my options.</p>