In Python, the defaultdict class provides a convenient way to create a mapping from key -> [list of values], in the following example,
defaultdict
key -> [list of values]
Using just the Java runtime library you could use a HashMap and add an ArrayList to hold your values when the key does not exist yet or add the value to the list when the key does exist.
HashMap
ArrayList