Made WordCounter example compatible with Java 6