Hey, iv just got a simple problem what would be the best method for storing this type of data

list of words followed by a list of files the word is contained in e.g

"hello" ["a.txt","b.txt","c.txt"]
"ok" ["b.txt","d.txt"]
"yes" ["a.txt","b.txt"]

would i use hashset -hashmap or is it possible with arraylist

which i wish to add to this list when i find another word contained in a file so if the word is new then it gets added otherwise if i word contained in a file such as "ok" in "f.txt" it becomes

"hello" ["a.txt","b.txt","c.txt"]
"ok" ["b.txt","d.txt","f.txt"]
"yes" ["a.txt","b.txt"]



cheers in advance