Fill in report so that it returns a word count listed alphabetically, in the form word:count separated by spaces (with a trailing space).
report
word:count
The program prints apple:1 fig:1 pear:2 . Use a TreeMap — with a HashMap the order would not be guaranteed.
apple:1 fig:1 pear:2
TreeMap
HashMap