code: private List<CmsBrokenLinkBean> getBrokenLinkBeans(Multimap<CmsResource, CmsResource> linkMap) throws CmsException {
  
          CmsBrokenLinkRenderer brokenLinkRenderer = new CmsBrokenLinkRenderer(getCmsObject());
  
          Multimap<CmsBrokenLinkBean, CmsBrokenLinkBean> resultMap = HashMultimap.create();
  
          for (CmsResource source : linkMap.keySet()) {
  
              for (CmsResource target : linkMap.get(source)) {
                  CmsBrokenLinkBean targetBean = createSitemapBrokenLinkBean(target);
                  addBrokenLinkAdditionalInfo(getCmsObject(), target, targetBean);
                  List<CmsBrokenLinkBean> brokenLinkBeans = brokenLinkRenderer.renderBrokenLink(target, source);
                  for (CmsBrokenLinkBean childBean : brokenLinkBeans) {
                      addBrokenLinkAdditionalInfo(getCmsObject(), source, childBean);
                      resultMap.put(childBean, targetBean);
                  }
              }
          }
  
          // now convert multimap representation to parent/child representation
          for (CmsBrokenLinkBean parent : resultMap.keySet()) {
              for (CmsBrokenLinkBean child : resultMap.get(parent)) {
                  parent.addChild(child);
              }
          }
          return Lists.newArrayList(resultMap.keySet());
      }
docs: Helper method for converting a map which maps resources to resources to a list of "broken link" beans,
  which have beans representing the source of the corresponding link as children.<p>
  
  @param linkMap a multimap from resource to resources
  
  @return a list of beans representing links which will be broken
  
  @throws CmsException if something goes wrong