@Test public void test() { String[] strs = {"and", "dan"}; Anagrams a = new Anagrams(); List<String> result = new ArrayList<String>(Arrays.asList(strs)); AssertUtil.assertArrayCommonEquals(result, a.anagrams(strs)); }
@Test public void test4() { String[] strs = {"tea", "cat", "abc", "tac", "eds", "cat", "egddfs", "eat"}; String[] ret = {"tea", "cat", "cat", "tac", "eat"}; Anagrams a = new Anagrams(); List<String> result = new ArrayList<String>(Arrays.asList(ret)); AssertUtil.assertArrayCommonEquals(result, a.anagrams(strs)); }