code: private static Integer checkNumItems(HttpServletRequest request,
  			ProcessRetrieveResponse response) {
  		String tmp = request.getParameter(ProtocolConstants.NUM_ITEMS);
  		Integer numItems = null;
  		if (tmp != null) {
  			try {
  				numItems = Integer.parseInt(tmp);
  				if ((numItems < 1)
  						|| (numItems > ProtocolConstants.MAX_NUMBER_OF_SUGGESTIONS)) {
  					numItems = ProtocolConstants.MAX_NUMBER_OF_SUGGESTIONS;
  					response.addNumItemsWarning(RetrieveStatusCodes.NUMITEMS_OUT_OF_RANGE);
  				}
  
  			} catch (NumberFormatException e) {
  				numItems = ProtocolConstants.MAX_NUMBER_OF_SUGGESTIONS;
  				response.addNumItemsWarning(RetrieveStatusCodes.NUMITEMS_NOT_AN_INTEGER);
  			}
  		} else {
  			numItems = ProtocolConstants.MAX_NUMBER_OF_SUGGESTIONS;
  			response.addNumItemsWarning(RetrieveStatusCodes.NUMITEMS_NOT_GIVEN);
  		}
  		return numItems;
  	}
docs: checks the ASTP request for the number of items that should be retrieved
  If the parameter is not set we use the default value If the parameter is
  not set correctly (no integer or bigger than the maximum allowed Integer
  or negative) we use the default value
  
  @param request
  @param response