public static <T> BinaryTree<T> LCA(BinaryTree<T> i, BinaryTree<T> j) {
        HashSet<BinaryTree<T>> hash = new HashSet<BinaryTree<T>>();
        while(i != null || j != null) {
            if(i != null) {
                if(hash.add(i) == false) {
                    return i; // adds a failed because a exists in hash.
                }
                i = i.getParent();
            }
            if(j != null) {
                if(hash.add(j) == false) {
                    return j; // adds a failed because a exists in hash.
                }
                j = j.getParent();
            }
        }
        // Throw error if a and b are not in the same tree.
        throw new RuntimeException("a and b are not in the same tree");
    }