code: protected List<CmsResource> shrinkToFit(List<CmsResource> result, int maxSize) {
  
          if ((maxSize > 0) && (result.size() > maxSize)) {
              // cut off all items > count
              result = result.subList(0, maxSize);
          }
  
          return result;
      }
docs: Shrinks a List to fit a maximum size.<p>
  
  @param result a List
  @param maxSize the maximum size of the List
  
  @return the reduced list