@Test public void testGetGoodWordStartingWith() { ArrayList<String> words = new ArrayList<>(Arrays.asList(wordsArray)); FastDictionary dict = new FastDictionary(words); assertFalse("cat".equals(dict.getGoodWordStartingWith("cat"))); assertEquals("catfishes", dict.getGoodWordStartingWith("catfishes")); assertEquals("catfishes", dict.getGoodWordStartingWith("catfish")); assertEquals("apple", dict.getGoodWordStartingWith("a")); assertEquals("apple", dict.getGoodWordStartingWith("apple")); }
@Override public String getGoodWordStartingWith(String prefix) { return root.getGoodWordStartingWith(prefix); }
FastDictionary implements GhostDictionary { @Override public String getGoodWordStartingWith(String prefix) { return root.getGoodWordStartingWith(prefix); } }
FastDictionary implements GhostDictionary { @Override public String getGoodWordStartingWith(String prefix) { return root.getGoodWordStartingWith(prefix); } FastDictionary(InputStream wordListStream); @VisibleForTesting  FastDictionary(List<String> words); }
FastDictionary implements GhostDictionary { @Override public String getGoodWordStartingWith(String prefix) { return root.getGoodWordStartingWith(prefix); } 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 String getGoodWordStartingWith(String prefix) { return root.getGoodWordStartingWith(prefix); } FastDictionary(InputStream wordListStream); @VisibleForTesting  FastDictionary(List<String> words); @Override boolean isWord(String word); @Override String getAnyWordStartingWith(String prefix); @Override String getGoodWordStartingWith(String prefix);  }