code: private static void tagHierarchyWithPairtreeMixin(final Node baseNode, final Node createdNode)
              throws RepositoryException {
          Node parent = createdNode.getParent();
  
          while (parent.isNew() && !parent.equals(baseNode)) {
              parent.addMixin(FEDORA_PAIRTREE);
              parent = parent.getParent();
          }
      }
docs: Tag a hierarchy with {@link org.fcrepo.kernel.api.FedoraTypes#FEDORA_PAIRTREE}
  @param baseNode Top most ancestor that should not be tagged
  @param createdNode Node whose parents should be tagged up to but not including {@code baseNode}
  @throws RepositoryException if repository exception occurred