code: private Map<String, List<CmsRelation>> getBrokenRelations(List<String> resourceNames) {
  
          Map<String, List<CmsRelation>> brokenRelations = new HashMap<String, List<CmsRelation>>();
  
          CmsRelationFilter filter = CmsRelationFilter.TARGETS.filterIncludeChildren().filterStructureId(
              CmsUUID.getNullUUID());
  
          Iterator<String> itFolders = resourceNames.iterator();
          while (itFolders.hasNext()) {
              String folderName = itFolders.next();
              List<CmsRelation> relations;
              try {
                  relations = m_cms.getRelationsForResource(folderName, filter);
              } catch (CmsException e) {
                  LOG.error(Messages.get().getBundle().key(Messages.LOG_LINK_SEARCH_1, folderName), e);
                  continue;
              }
              Iterator<CmsRelation> itRelations = relations.iterator();
              while (itRelations.hasNext()) {
                  CmsRelation relation = itRelations.next();
                  // target is broken
                  String resourceName = relation.getSourcePath();
                  List<CmsRelation> broken = brokenRelations.get(resourceName);
                  if (broken == null) {
                      broken = new ArrayList<CmsRelation>();
                      brokenRelations.put(resourceName, broken);
                  }
                  broken.add(relation);
              }
          }
          return brokenRelations;
      }
docs: Returns a map of where each entry has as key a name of a resource to be validated,
  and value a list of relations that are broken.<p>
  
  @param resourceNames a list of resource names to be validated
  
  @return a map of broken relations