WORDS-333 - create tests for CountWordsTask class, some refactoring