@Test public void testIsWord() { ArrayList<String> words = new ArrayList<>(Arrays.asList(wordsArray)); FastDictionary dict = new FastDictionary(words); assertTrue(dict.isWord("cat")); assertTrue(dict.isWord("cats")); assertFalse(dict.isWord("c")); assertFalse(dict.isWord("fish")); }
@Override public boolean isWord(String word) { return root.isWord(word); }
FastDictionary implements GhostDictionary { @Override public boolean isWord(String word) { return root.isWord(word); } }
FastDictionary implements GhostDictionary { @Override public boolean isWord(String word) { return root.isWord(word); } FastDictionary(InputStream wordListStream); @VisibleForTesting  FastDictionary(List<String> words); }
FastDictionary implements GhostDictionary { @Override public boolean isWord(String word) { return root.isWord(word); } FastDictionary(InputStream wordListStream); @VisibleForTesting  FastDictionary(List<String> words); @Override boolean isWord(String word); @Override String getAnyWordStartingWith(String prefix); @Override String getGoodWordStartingWith(String prefix); }
FastDictionary implements GhostDictionary { @Override public boolean isWord(String word) { return root.isWord(word); } FastDictionary(InputStream wordListStream); @VisibleForTesting  FastDictionary(List<String> words); @Override boolean isWord(String word); @Override String getAnyWordStartingWith(String prefix); @Override String getGoodWordStartingWith(String prefix);  }