docs: protected SessionNode removeChildFromNode( AbstractSessionCache session,
                                                 NodeKey childKey ) {
          // First, manipulate the child node. But we have to see whether this node is a primary parent or an additional parent ...
          SessionNode child = session.mutable(childKey);
          NodeKey parentKey = child.getParentKey(session);
          if (parentKey != null) {
              if (parentKey.equals(this.key)) {
                  // The child's parent is this node. If there are additional parents, then we should pick the first additional parent
                  // and use it as the new primary parent ...
                  Set<NodeKey> additionalParentKeys = child.getAdditionalParentKeys(session);
                  if (additionalParentKeys.isEmpty()) {
                      child.newParent = null;
                  } else {
                      // There are additional parents, and we're removing the primary parent
                      NodeKey newParentKey = additionalParentKeys.iterator().next();
                      child.replaceParentWithAdditionalParent(session, this.key, newParentKey);
                  }
              } else {
                  // The child's parent is NOT this node, so this node must be an additional parent...
                  boolean removed = child.removeAdditionalParent(session, this.key);
                  if (!removed) {
                      // Not a primary or additional parent ...
                      if (!getChildReferences(session).hasChild(childKey)) {
                          throw new NodeNotFoundException(childKey);
                      }
                  }
              }
          } else {
              LOGGER.warn(JcrI18n.warnCorruptedChildParentRef, childKey);
          }
  
          // Now, update this node (the parent) ...
          MutableChildReferences appended = this.appended.get();
          ChildReference removed = null;
          if (appended != null) {
              removed = appended.remove(childKey); // The node may have been appended to this node but not yet persisted ...
          }
          if (removed == null) {
              changedChildren.remove(childKey);
          }
          return child;
      }