docs: protected Name nextNameForVersionNode( Property predecessors,
                                             ChildReferences historyChildren ) {
          String proposedName = null;
          CachedNode versionNode = null;
  
          // Try to find the versions in the history that are considered predecessors ...
          if (predecessors != null) {
              for (Object predecessor : predecessors) {
                  if (predecessor == null) continue;
                  NodeKey key = ((NodeKeyReference)predecessor).getNodeKey();
                  CachedNode predecessorNode = system.getNode(key);
                  Name predecessorName = predecessorNode.getName(system);
                  if (proposedName == null || predecessorName.getLocalName().length() < proposedName.length()) {
                      proposedName = predecessorName.getLocalName();
                      versionNode = predecessorNode;
                  }
              }
          }
          if (proposedName == null) {
              proposedName = "1.0";
              Name versionName = names.create(proposedName);
              if (historyChildren.getChild(versionName) == null) return versionName;
              // Otherwise use the root version ...
              versionNode = system.getNode(historyChildren.getChild(JcrLexicon.ROOT_VERSION));
          }
          assert versionNode != null;
  
          // Now make sure the name is not used ...
          int index = proposedName.lastIndexOf('.');
          if (index > 0) {
              proposedName = proposedName.substring(0, index + 1) + (Integer.parseInt(proposedName.substring(index + 1)) + 1);
              Name versionName = names.create(proposedName); // excludes the trailing '.'
              while (historyChildren.getChild(versionName) != null) {
                  proposedName = proposedName + ".0";
                  versionName = names.create(proposedName);
              }
              return versionName;
          }
  
          // Get the number of successors of the version
          Property successors = versionNode.getProperty(JcrLexicon.SUCCESSORS, system);
          String baseName = successors != null ? Integer.toString(successors.size() + 1) : "1";
          return names.create(baseName + ".0");
      }