code: protected boolean checkLinkForDeletedLinkTarget(
          CmsRelation relation,
          String link,
          Map<String, CmsResource> fileLookup,
          HashMultimap<String, String> relationTargets) {
  
          boolean isValidLink = false;
          // since we are going to delete the resource
          // check if the linked resource is also to be deleted
          if (fileLookup.containsKey(link)) {
              CmsResource offlineResource = fileLookup.get(link);
              Set<String> relationTargetsForLink = relationTargets.get(link);
              boolean hasNoRelations = !relationTargetsForLink.contains(relation.getTargetPath())
                  && !relationTargetsForLink.contains(relation.getTargetId().toString());
              isValidLink = offlineResource.getState().isDeleted() || hasNoRelations;
          }
          return isValidLink;
      }
docs: Checks a link to a resource which has been deleted.<p>
  @param relation
  
  @param link the URI of the resource which has a link to the deleted resource
  @param fileLookup a lookup table of files to be published
  @param relationTargets
  
  @return true if the resource which has a link to the deleted resource is also going to be deleted