code: public static int getInt(Properties config, String key, int defaultValue) {
  		String val = config.getProperty(key);
  		if (val == null) {
  			return defaultValue;
  		} else {
  			try {
  				return Integer.parseInt(val);
  			} catch (NumberFormatException nfe) {
  				throw new IllegalArgumentException("Value for configuration key='" + key + "' is not set correctly. " +
  						"Entered value='" + val + "'. Default value='" + defaultValue + "'");
  			}
  		}
  	}
docs: Get integer from properties.
  This method throws an exception if the integer is not valid.
  
  @param config Properties
  @param key key in Properties
  @param defaultValue default value if value is not set
  @return default or value of key