code: private ResourceMap getResourcesAndRelated(
          List<CmsResource> resources,
          boolean includeRelated,
          boolean includeSiblings,
          boolean keepOriginalUnchangedResources,
          I_CmsPublishRelatedResourceProvider relProvider) {
  
          Set<CmsResource> publishResources = new HashSet<CmsResource>();
          publishResources.addAll(resources);
          if (includeSiblings) {
              addSiblings(publishResources);
          }
          ResourceMap result;
          if (includeRelated) {
              CmsPublishRelationFinder relationFinder = new CmsPublishRelationFinder(
                  getCmsObject(),
                  publishResources,
                  keepOriginalUnchangedResources,
                  relProvider);
  
              result = relationFinder.getPublishRelatedResources();
          } else {
              result = new ResourceMap();
              for (CmsResource resource : publishResources) {
                  if (keepOriginalUnchangedResources || !resource.getState().isUnchanged()) {
                      result.put(resource, new HashSet<CmsResource>());
                  }
              }
          }
          return result;
      }
docs: Gets the resource map containing the publish resources together with their related resources.<p>
  
  @param resources the base list of publish resources
  @param includeRelated flag to control whether related resources should be included
  @param includeSiblings flag to control whether siblings should be included
  @param keepOriginalUnchangedResources flag which determines whether unchanged resources in the original resource list should be kept or removed
  @param relProvider the provider for additional related resources
  
  @return the resources together with their related resources