@Test public void spellComplete() { LetterSource letterD = TestUtil.createLetterSource("D"); letterD.available = 0; List<LetterSource> availableLetters = Arrays.asList( TestUtil.createLetterSource("O"), TestUtil.createLetterSource("A"), TestUtil.createLetterSource("B"), TestUtil.createLetterSource("C"), letterD, TestUtil.createLetterSource("E")); SpelledWord spelledWord = WordUtil.spell(availableLetters, "OK"); assertTrue(spelledWord.isComplete()); assertNotNull(spelledWord.letters); assertEquals(2, spelledWord.letters.size()); assertEquals("O", spelledWord.letters.get(0).letter); assertTrue(spelledWord.letters.get(0).isSingleSource()); assertTrue(spelledWord.letters.get(0).isComplete()); assertNotNull(spelledWord.letters.get(0).sources); assertEquals(1, spelledWord.letters.get(0).sources.size()); assertEquals("O", spelledWord.letters.get(0).sources.get(0).letter); assertEquals(1, spelledWord.letters.get(0).sources.get(0).available); assertEquals("K", spelledWord.letters.get(1).letter); assertFalse(spelledWord.letters.get(1).isSingleSource()); assertTrue(spelledWord.letters.get(1).isComplete()); }
public static SpelledWord spell(List<LetterSource> letters, String word) { AvailableLetters availableLetters = new AvailableLetters(letters); return spell(availableLetters, word); }
WordUtil { public static SpelledWord spell(List<LetterSource> letters, String word) { AvailableLetters availableLetters = new AvailableLetters(letters); return spell(availableLetters, word); } }
WordUtil { public static SpelledWord spell(List<LetterSource> letters, String word) { AvailableLetters availableLetters = new AvailableLetters(letters); return spell(availableLetters, word); }  }
WordUtil { public static SpelledWord spell(List<LetterSource> letters, String word) { AvailableLetters availableLetters = new AvailableLetters(letters); return spell(availableLetters, word); }  static SpelledWord spell(List<LetterSource> letters, String word); static int[] getWordColors(List<LetterSource> letters, String word); static int[] getWordColors(List<SpelledLetter> letters); }
WordUtil { public static SpelledWord spell(List<LetterSource> letters, String word) { AvailableLetters availableLetters = new AvailableLetters(letters); return spell(availableLetters, word); }  static SpelledWord spell(List<LetterSource> letters, String word); static int[] getWordColors(List<LetterSource> letters, String word); static int[] getWordColors(List<SpelledLetter> letters); static final int COLOR_MISSING; static final int COLOR_ONE; static final int COLOR_COMBO; }