import java.util.List; /** * Interface for an object which can check for anagrams. An anagram is a reordering * of the letters in a word or phrase. * */ public interface IAnagramChecker { /** Determine whether one word is an anagram of the other. * Non-alphanumeric characters are ignored. The check is * case-insensitive. * @param word1 any non-null string. * @param word2 any non-null string. * @return true iff the second word is an anagram of the first. */ boolean isAnagram(String word1, String word2); /** Find all anagrams (if any) of a given word in a dictionary * (list) of words. * @param dictionary a non-null list of strings. * @param word a non-null string. * @return a list of all words from the dictionary which are * anagrams of the given word, using the same criteria as * in method isAnagram. The returned list may be empty but * not null. */ List findAnagrams(List dictionary, String word); }