### Question:
Spelling { static int loadDictionary(InputStream file, TrieNode possiblesTrie, Map<String, Integer> dictionary) throws IOException { int wordLen = 0; BufferedReader in = new BufferedReader(new InputStreamReader(file)); Pattern p = Pattern.compile("[A-Za-z]+"); for (String temp = ""; temp != null; temp = in.readLine()) { Matcher m = p.matcher(temp.toLowerCase()); while (m.find()) { temp = m.group(); if (dictionary != null) { dictionary.put(temp, dictionary.containsKey(temp) ? dictionary.get(temp) + 1 : 1); } if (temp.length() > wordLen) { wordLen = temp.length(); } if (possiblesTrie != null){ possiblesTrie.insert(temp); } } } in.close(); return wordLen; } Spelling(InputStream file);   }### Answer:
@Test public void testDictionaryLoad() throws Exception { Spelling.loadDictionary(ClassLoader.getSystemResourceAsStream("dictionary.txt"), possibles, null); }