Tests updated to reflect new _buildHierarchy behavior.