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]
You can use MultiMap from Apache Commons.