private double getVariableIndex(ExpressionNode node, ContextIndex context) {
        if (!(node instanceof ReferenceNode fNode)) {
            throw new IllegalArgumentException("Contained a left-hand comparison expression " +
                                               "which was not a feature value but was: " + node);
        }
        Integer index = context.getIndex(fNode.toString());
        if (index == null) {
            throw new IllegalStateException("The ranking expression contained feature '" + fNode.getName() +
                                            "', which is not known to " + context + ": The context must be created" +
                                            "from the same ranking expression which is to be optimized");
        }
        return index;
    }
Consumes the if condition and return the size of the values resulting, for convenience
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/evaluation/gbdtoptimization/GBDTOptimizer.java