java array matching to show the unique result : i am new to the java array matching.

I have two arrays. each array has the same number of element: 11

    txtfilename=['txt1','txt6','txt6','txt6','txt7','txt7','txt8','txt9','txt9','txt9','txt9']
    content=['apple from one','six trees','cats','happy dogs','healthy fruit','good job','ask question','check safety','stay in the house','good results','happy holiday']

in fact, the same position of element in txtfilename is matched the same position of element in content. 

for example: the 2nd element in the txtfilename is matched the 2nd element in the content. 

however, txtfilename has duplicated element, the element of content is unique.

I have the problem of matching these two arrays. 
I want to display these two array as following:

    txtfilename: txt1
    content: apple from one

    txtfilename:txt6
    content:'six trees','cats','happy dogs'
    
    txtfilename:txt7
    content:'healthy fruit','good job'
    
    txtfilename:txt8
    content:'ask question'
    
    txtfilename:txt9
    content:'check safety','stay in the house','good results','happy holiday'

