private static double validate(double value, String valueName) {
        if (Double.isNaN(value)) throw new IllegalArgumentException(valueName + " cannot be NaN");
        if (Double.isInfinite(value)) throw new IllegalArgumentException(valueName + " cannot be infinite");
        return value;
    }
Returns this.isUnspecified() ? Optional.empty() : Optional.of(this)
config-provisioning/src/main/java/com/yahoo/config/provision/NodeResources.java