#NEWLINE# def validateHierarchicalContainer( self , container , expectedFirstItemId , expectedLastItemId , itemIdInSet , itemIdNotInSet , checkGetItemNull , expectedSize , expectedRootSize , rootsHaveChildren ) : #NEWLINE# #INDENT# '@param container:\n                   The container to validate\n        @param expectedFirstItemId:\n                   Expected first item id\n        @param expectedLastItemId:\n                   Expected last item id\n        @param itemIdInSet:\n                   An item id that is in the container\n        @param itemIdNotInSet:\n                   An item id that is not in the container\n        @param checkGetItemNull:\n                   true if getItem() should return null for itemIdNotInSet,\n                   false to skip the check (container.containsId() is checked\n                   in any case)\n        @param expectedSize:\n                   Expected number of items in the container. Not related to\n                   hierarchy.\n        @param expectedTraversalSize:\n                   Expected number of items found when traversing from the\n                   roots down to all available nodes.\n        @param expectedRootSize:\n                   Expected number of root items\n        @param rootsHaveChildren:\n                   true if all roots have children, false otherwise (skips\n                   some asserts)\n        ' #NEWLINE# self . validateContainer ( container , expectedFirstItemId , expectedLastItemId , itemIdInSet , itemIdNotInSet , checkGetItemNull , expectedSize ) #NEWLINE# rootIds = container . rootItemIds ( ) #NEWLINE# self . assertEquals ( expectedRootSize , len ( rootIds ) ) #NEWLINE# for rootId in rootIds : #NEWLINE# #INDENT# self . assertTrue ( container . containsId ( rootId ) ) #NEWLINE# self . assertEquals ( container . getParent ( rootId ) , None ) #NEWLINE# self . assertTrue ( container . isRoot ( rootId ) ) #NEWLINE# if rootsHaveChildren : #NEWLINE# #INDENT# self . assertTrue ( container . areChildrenAllowed ( rootId ) ) #NEWLINE# children = container . getChildren ( rootId ) #NEWLINE# self . assertNotEquals ( children , None , ( rootId + ' should have children' ) ) #NEWLINE# self . assertTrue ( ( len ( children ) > 0 ) , ( rootId + ' should have children' ) ) #NEWLINE# for childId in children : #NEWLINE# #INDENT# self . assertEquals ( container . getParent ( childId ) , rootId ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# self . assertFalse ( container . isRoot ( itemIdNotInSet ) ) #NEWLINE# self . assertFalse ( container . hasChildren ( itemIdNotInSet ) ) #NEWLINE# self . assertFalse ( container . areChildrenAllowed ( itemIdNotInSet ) ) #NEWLINE# self . assertFalse ( container . removeItem ( itemIdNotInSet ) ) #NEWLINE# self . assertEquals ( expectedSize , self . countNodes ( container ) ) #NEWLINE# self . validateHierarchy ( container )