If pattern matches then print the corresponding mapped words
if ( it . getKey ( ) . equals ( pattern ) ) { wordFound = true ; for ( String s : it . getValue ( ) ) System . out . print ( s + "NEW_LINE"); } }