Restores previously stored expand state, making best effort to do it even if content of the Tree has slightly changed.
Comparison is used to compare the new tree to the old when you have for example refreshed your TreeView totally, then new nodes are compared to the old.