added collapseHierarchy recognition + tests(#175)