public HashSet<String> connectTo(String word) {
            char[] wordChars = word.toCharArray();
            HashSet<String> result = new HashSet<String>();
            for (int i = 0; i < wordChars.length; i++) {
                char before = wordChars[i];
                wordChars[i] = (char) 0;
                String key = String.valueOf(wordChars);

                HashSet<String> valueSet = graph.get(key);
                if (valueSet == null)
                    return null;

                result.addAll(valueSet);

                wordChars[i] = before;
            }
            return result;
        }