Testing collapseTree