import java.util.*; class WordCount { public WordCount() { List words = new ArrayList(); Scanner console = new Scanner(System.in); while (console.hasNextLine()) { String line = console.nextLine(); Scanner tokenizer = new Scanner(line); while (tokenizer.hasNext()) { String word = tokenizer.next(); words.add(word); } tokenizer.close(); } console.close(); countWordFrequencies(words); } void countWordFrequencies(List words) { // YOUR CODE GOES HERE /* Code you may need Set> wordSet = frequencyCount.entrySet(); List> wordList = new ArrayList>(wordSet); */ } public static void main(String args[]) { new WordCount(); } }