code: private MortarScope searchFromRoot(Scoped scoped)
    {
      // Ascend to the root.
      MortarScope root = this;
      while (root.parent != null) {
        root = root.parent;
      }
  
      // Do the non-recursive search.
      List<MortarScope> scopes = new LinkedList<>();
      scopes.add(root);
  
      while (!scopes.isEmpty()) {
        // Check first scope in the list.
        MortarScope scope = scopes.get(0);
  
        if (scope.tearDowns.contains(scoped)) {
          return scope;
        }
  
        // Replace the first scope with its children (breadth-first search).
        scopes.addAll(scope.children.values());
        scopes.remove(0);
      }
  
      return null;
    }
docs: Find the scope from the root of the hierarchy, in which the scoped object is registered.