docs: private Map<String, List<CmsRelation>> getBrokenRelations(List<String> resourceNames, boolean includeSiblings) {
  
          Map<String, List<CmsRelation>> brokenRelations = new HashMap<String, List<CmsRelation>>();
          Set<String> resources = new HashSet<String>();
          // expand the folders to single resources
          String site = m_cms.getRequestContext().getSiteRoot();
          String oldSite = site;
          try {
              m_cms.getRequestContext().setSiteRoot("/");
              List<CmsResource> resourceList = new ArrayList<CmsResource>();
              Iterator<String> itResourceNames = resourceNames.iterator();
              while (itResourceNames.hasNext()) {
                  // get the root path
                  String resName = m_cms.getRequestContext().addSiteRoot(site, itResourceNames.next());
                  try {
                      CmsResource resource = m_cms.readResource(resName);
                      resourceList.add(resource);
                      if (resource.isFolder()) {
                          resourceList.addAll(m_cms.readResources(resName, CmsResourceFilter.IGNORE_EXPIRATION, true));
                      }
                  } catch (CmsException e) {
                      // should never happen
                      if (LOG.isDebugEnabled()) {
                          LOG.debug(e.getLocalizedMessage(), e);
                      }
                  }
              }
  
              // collect the root paths
              Iterator<CmsResource> itResources = resourceList.iterator();
              while (itResources.hasNext()) {
                  CmsResource resource = itResources.next();
                  resources.add(resource.getRootPath());
              }
  
              if (Boolean.valueOf(includeSiblings).booleanValue()) {
                  // expand the siblings
                  itResources = new ArrayList<CmsResource>(resourceList).iterator();
                  while (itResources.hasNext()) {
                      CmsResource resource = itResources.next();
                      try {
                          if (!resource.isFolder() && (resource.getSiblingCount() > 1)) {
                              Iterator<CmsResource> itSiblings = m_cms.readSiblings(
                                  resource.getRootPath(),
                                  CmsResourceFilter.IGNORE_EXPIRATION).iterator();
                              while (itSiblings.hasNext()) {
                                  CmsResource sibling = itSiblings.next();
                                  if (!resources.contains(sibling.getRootPath())) {
                                      resources.add(sibling.getRootPath());
                                      resourceList.add(sibling);
                                  }
                              }
                          }
                      } catch (CmsException e) {
                          // should never happen
                          if (LOG.isErrorEnabled()) {
                              LOG.error(e.getLocalizedMessage(), e);
                          }
                      }
                  }
              }
  
              // check every resource
              itResources = resourceList.iterator();
              while (itResources.hasNext()) {
                  CmsResource resource = itResources.next();
                  String resourceName = resource.getRootPath();
                  try {
                      Iterator<CmsRelation> it = m_cms.getRelationsForResource(
                          resource,
                          CmsRelationFilter.SOURCES).iterator();
                      while (it.hasNext()) {
                          CmsRelation relation = it.next();
                          String relationName = relation.getSourcePath();
                          // add only if the source is not to be deleted too
                          if (!resources.contains(relationName)) {
                              List<CmsRelation> broken = brokenRelations.get(resourceName);
                              if (broken == null) {
                                  broken = new ArrayList<CmsRelation>();
                                  brokenRelations.put(resourceName, broken);
                              }
                              broken.add(relation);
                          }
                      }
                  } catch (CmsException e) {
                      // should never happen
                      if (LOG.isErrorEnabled()) {
                          LOG.error(e.getLocalizedMessage(), e);
                      }
                  }
              }
          } finally {
              m_cms.getRequestContext().setSiteRoot(oldSite);
          }
          return brokenRelations;
      }