You can determine if an object exists within a tree.
To determine if a specific object exists in the structure tree, use:
boolean result = [Tree].hasObject(String objectID);