code: private void checkSameNameSibling(NodeData node, WorkspaceStorageConnection con, final Set<QPath> addedNodes)
        throws RepositoryException
     {
        if (node.getQPath().getIndex() > 1)
        {
           // check if an older same-name sibling exists
           // the check is actual for all operations including delete
  
           final QPathEntry[] path = node.getQPath().getEntries();
           final QPathEntry[] siblingPath = new QPathEntry[path.length];
           final int li = path.length - 1;
           System.arraycopy(path, 0, siblingPath, 0, li);
  
           siblingPath[li] = new QPathEntry(path[li], path[li].getIndex() - 1);
  
           if (addedNodes.contains(new QPath(siblingPath)))
           {
              // current changes log has the older same-name sibling
              return;
           }
           else
           {
              // check in persistence
              if (dataContainer.isCheckSNSNewConnection())
              {
                 final WorkspaceStorageConnection acon = dataContainer.openConnection();
                 try
                 {
                    checkPersistedSNS(node, acon);
                 }
                 finally
                 {
                    acon.close();
                 }
              }
              else
              {
                 checkPersistedSNS(node, con);
              }
           }
        }
     }
docs: Check if given node path contains index higher 1 and if yes if same-name sibling exists in
  persistence or in current changes log.