Anagrams { public List<String> getAnagrams(String word) { String signature = getSignature(word); if (!signatureToWord.containsKey(signature)) { return null; } List<String> anagrams = signatureToWord.get(signature); return new ArrayList<String>(anagrams); } Anagrams(); List<String> getAnagrams(String word);  }
@Test public void testGetAnagrams() { List<String> anagrams = tester.getAnagrams("caret"); assertTrue(anagrams.contains("cater")); assertTrue(anagrams.contains("crate")); assertTrue(anagrams.contains("react")); assertTrue(anagrams.contains("recta")); assertTrue(anagrams.contains("trace")); }