code: protected static List<CmsResource> limitCollectorResult(
          CmsContentInfoBean contentInfoBean,
          List<CmsResource> collectorResult) {
  
          List<CmsResource> result = null;
          int pageCount = -1;
  
          if (contentInfoBean.getPageSize() > 0) {
  
              pageCount = collectorResult.size() / contentInfoBean.getPageSize();
              if ((collectorResult.size() % contentInfoBean.getPageSize()) != 0) {
                  pageCount++;
              }
  
              contentInfoBean.setPageCount(pageCount);
  
              int startIndex = (contentInfoBean.getPageIndex() - 1) * contentInfoBean.getPageSize();
              int endIndex = contentInfoBean.getPageIndex() * contentInfoBean.getPageSize();
              if (endIndex > collectorResult.size()) {
                  endIndex = collectorResult.size();
              }
  
              result = collectorResult.subList(startIndex, endIndex);
          } else {
  
              result = collectorResult;
              if (collectorResult.size() > 0) {
                  contentInfoBean.setPageCount(1);
              }
          }
  
          return result;
      }
docs: Limits the collector's result list to the size of a page to be displayed in a JSP.<p>
  
  @param contentInfoBean the info bean of the collector
  @param collectorResult the result list of the collector
  
  @return a limited collector's result list