code: public void limitMaximumPageSize(int limit) {
  
      if (getPagination() == PaginationTo.NO_PAGINATION) {
        setPagination(new PaginationTo());
      }
  
      Integer pageSize = getPagination().getSize();
      if ((pageSize == null) || (pageSize.intValue() > limit)) {
        getPagination().setSize((Integer.valueOf(limit)));
      }
    }
docs: Limits the {@link PaginationTo#getSize() page size} by the given <code>limit</code>.
  <p>
  If currently no pagination is active, or the {@link PaginationTo#getSize() current page size} is {@code null} or
  greater than the given {@code limit}, the value is replaced by {@code limit}
  
  @param limit is the maximum allowed value for the {@link PaginationTo#getSize() page size}.