@Test public void spellRepeatedLetter() { LetterSource alice = TestUtil.createLetterSource("A"); alice.displayName = "Alice"; LetterSource amy = TestUtil.createLetterSource("A"); amy.displayName = "Amy"; LetterSource belinda = TestUtil.createLetterSource("B"); belinda.displayName = "Belinda"; List<LetterSource> availableLetters = Arrays.asList(amy, belinda, alice); SpelledWord spelledWord = WordUtil.spell(availableLetters, "BAA"); assertTrue(spelledWord.isComplete()); assertNotNull(spelledWord.letters); assertEquals(3, spelledWord.letters.size()); assertEquals("B", 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("B", spelledWord.letters.get(0).sources.get(0).letter); assertEquals("Belinda", spelledWord.letters.get(0).sources.get(0).displayName); assertEquals(1, spelledWord.letters.get(0).sources.get(0).available); assertEquals("A", spelledWord.letters.get(1).letter); assertTrue(spelledWord.letters.get(1).isSingleSource()); assertTrue(spelledWord.letters.get(1).isComplete()); assertNotNull(spelledWord.letters.get(1).sources); assertEquals(1, spelledWord.letters.get(1).sources.size()); assertEquals("A", spelledWord.letters.get(1).sources.get(0).letter); assertEquals("Alice", spelledWord.letters.get(1).sources.get(0).displayName); assertEquals(1, spelledWord.letters.get(1).sources.get(0).available); assertEquals("A", spelledWord.letters.get(2).letter); assertTrue(spelledWord.letters.get(2).isSingleSource()); assertTrue(spelledWord.letters.get(2).isComplete()); assertNotNull(spelledWord.letters.get(2).sources); assertEquals(1, spelledWord.letters.get(2).sources.size()); assertEquals("A", spelledWord.letters.get(2).sources.get(0).letter); assertEquals("Amy", spelledWord.letters.get(2).sources.get(0).displayName); assertEquals(1, spelledWord.letters.get(2).sources.get(0).available); }
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; }