I think using a hashmap with an List is what you're specifically asking for. An example of how to instantiate such an object would be:
HashMap<Integer, List<String>> myHashMap = new HashMap<Integer, List<String>>();
Note that we have to use Integer
because Hashmaps only work with objects. To add values to this, you could do:
myHashMap.get([whatever year you wanted]).add("[whatever name you want]");
However, a look at this question shows this would not be quite as easy as this, as you must instantiate each List for all your key's (that question deals specifically with multidimensional hashmaps, but the premise is the same). However, it is doable, as the answer to that question demonstrates. You should have a look at it, as I think it will you help you understand what's going on with all this, but the code that might work for you could look like (taken almost directly from the answer to the linked question):
if (!myHashMap.containsKey(myYear)) {
myHashMap.put(myYear, new List<String>());
}
Edit: If you can't use the List inside either, I suppose you could put another hashmap inside, but I don't see that having much real use for this unless it's just an arbitrary requirement.