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