@Test public void spellPartial() { LetterSource letterW = TestUtil.createLetterSource("W"); letterW.available = 0; List<LetterSource> availableLetters = Arrays.asList( TestUtil.createLetterSource("O"), TestUtil.createLetterSource("Z"), letterW); SpelledWord spelledWord = WordUtil.spell(availableLetters, "OK"); assertFalse(spelledWord.isComplete()); assertNotNull(spelledWord.letters); assertEquals(2, spelledWord.letters.size()); assertNotNull(spelledWord.letters.get(0)); 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); assertNotNull(spelledWord.letters.get(1)); assertEquals("K", spelledWord.letters.get(1).letter); assertFalse(spelledWord.letters.get(1).isSingleSource()); assertFalse(spelledWord.letters.get(1).isComplete()); assertNotNull(spelledWord.letters.get(1).sources); assertEquals(1, spelledWord.letters.get(1).sources.size()); assertEquals("Z", spelledWord.letters.get(1).sources.get(0).letter); }
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; }