Add TSTree_collect and test