docs: protected ChildReference parentReferenceToSelf( WorkspaceCache cache ) {
          CachedNode currentParent = null;
  
          // If we currently have cached our parent's reference to us (and it is still complete) ...
          ParentReferenceToSelf prts = parentRefToSelf.get();
          if (prts != null && prts.isComplete()) {
              if (prts.isRoot()) {
                  // We are the root node (always), so we can immediately return ...
                  return prts.childReferenceInParent();
              }
              // Get the current parent to compare with what we've cached ...
              currentParent = parent(cache);
              if (currentParent == null && prts.isRoot()) {
                  // We are the root and this never changes. Therefore, our 'parentRefToSelf' is always valid ...
                  return prts.childReferenceInParent();
              }
              if (prts.isValid(currentParent)) {
                  // Our cached form still looks okay ...
                  return prts.childReferenceInParent();
              }
              // Our cached form is no longer valid so we have to build a new one ...
          }
  
          // We have to (re)find our parent's reference to us ...
          if (currentParent == null) currentParent = parent(cache);
          if (currentParent == null) {
              // This is the root node ...
              parentRefToSelf.compareAndSet(null, new RootParentReferenceToSelf(cache));
              return parentRefToSelf.get().childReferenceInParent(); // always get the most recent
          }
  
          // The rest of this logic is only for non-root nodes ...
          assert currentParent != null;
  
          // Get our parent's child references to find which one points to us ...
          int retryCount = 1;
          ChildReference parentRefToMe = searchReferenceForSelf(cache, currentParent);
          NodeKey parentKey = getParentKey(cache);
          while (parentRefToMe == null && retryCount-- > 0) {
              // we weren't able to find this node with its reported parent, so clear the parent from the
              // ws cache and try getting the child reference from the latest persisted copy of the parent 
              // see https://issues.jboss.org/browse/MODE-2502
              assert parentRefToMe == null;
              cache.purge(parentKey);
              currentParent = parent(cache);
              parentRefToMe = searchReferenceForSelf(cache, currentParent);
          }
          
          if (parentRefToMe != null) {
              // We found a new ChildReference instance from the current parent, so cache it ...
              parentRefToSelf.set(new NonRootParentReferenceToSelf(currentParent, parentRefToMe));
              return parentRefToSelf.get().childReferenceInParent(); // always get the most recent
          } 
          // This node references a parent, but that parent no longer has a child reference to this node. Perhaps this node is
          // in the midst of being moved or removed. Either way, we don't have much choice but to throw an exception about
          // us not being found...
          throw new NodeNotFoundInParentException(key, parentKey);
      }