Implement nodeHasOnlyOneChild method