docs: final boolean canAddNode( String relPath,
                                String primaryNodeTypeName ) throws RepositoryException {
          CheckArg.isNotEmpty(relPath, relPath);
          checkSession();
  
          // Determine the path ...
          Path path = null;
          try {
              path = session().pathFactory().create(relPath);
          } catch (org.modeshape.jcr.value.ValueFormatException e) {
              return false;
          }
          if (path.size() == 0) {
              return false;
          }
          if (path.isIdentifier()) {
              return false;
          }
          if (path.getLastSegment().getIndex() > 1 || relPath.endsWith("]")) {
              return false;
          }
          if (path.size() > 1) {
              // The only segment in the path is the child name ...
              Path parentPath = path.getParent();
              try {
                  // Find the parent node ...
                  AbstractJcrNode other = session.node(node(), parentPath);
                  return other.canAddNode(primaryNodeTypeName);
              } catch (RepositoryException e) {
                  return false;
              }
          }
          return this.canAddNode(primaryNodeTypeName);
      }