I read the main function first. I saw that call to countOccurances, without an argument. I was confused how it was going to count occurances if it didn't know what it was looking for. Then I noticed the implementation of this method above.
Had there have been a type of Map<string, int>, I'd have reasoned what it does easily.
I hate type inference, it does not help.