private Set<Node> getAdjacent(Set<String> dict, Node word, Node end) {
            Set<Node> adjSet = new LinkedHashSet<>();
            StringBuilder sb = new StringBuilder(word.value);
            int length = word.value.length();
            for (int i = 0; i < length; i++) {
                char ch = sb.charAt(i);
                for (char c = 'a'; c < 'z'; c++) {
                    if (ch == c)    continue;
                    
                    sb.setCharAt(i, c);
                    if (dict.contains(sb.toString())) {
                        if (end.value.equals(sb.toString())) {
                            adjSet.add(end);
                            end.prevs.add(word);
                        } else {
                            adjSet.add(new Node(sb.toString(), word));
                            dict.remove(sb.toString());
                        }
                    }
                }
                sb.setCharAt(i, ch);
            }
            
            return adjSet;
        }