public OptionalDouble getDouble(String name) {
        Object feature = features.get(name);
        if (feature == null) return OptionalDouble.empty();
        if (feature instanceof Double) return OptionalDouble.of((Double)feature);
        throw new IllegalArgumentException("Expected '" + name + "' to be a double, but it is " +
                                           (feature instanceof Tensor ? "the tensor " + ((Tensor)feature).toAbbreviatedString() :
                                            "the string '" + feature + "'"));
    }
Returns a double rank feature, or empty if there is no value with this name.

@throws IllegalArgumentException if the value is set but is not a double
container-search/src/main/java/com/yahoo/search/query/ranking/RankFeatures.java