public Double getDoubleInRange(String name, Double defaultVal, Double start, Double end) {
    Double v = containsKey(name) ? Double.valueOf(Double.parseDouble(getProperty(name))) : defaultVal;
    // use big decimal for double comparison
    BigDecimal startDecimal = new BigDecimal(start);
    BigDecimal endDecimal = new BigDecimal(end);
    BigDecimal value = new BigDecimal(v);
    if (value.compareTo(startDecimal) >= 0 && value.compareTo(endDecimal) <= 0) {
      return v;
    } else {
      throw new IllegalArgumentException(
          name + " has value " + v + " which is not in range " + start + "-" + end + ".");
    }
  }
Read a short from the properties instance. Throw an exception if the value is not among the allowed values
@param name The property name
@param defaultVal The default value to use if the property is not found
@param allowedValues The array of allowed values for this property.
@return the Short value
ambry-api/src/main/java/com/github/ambry/config/VerifiableProperties.java