private String resolve(String expression, Map<String, String> ranking) {
        int referenceStartIndex;
        while ((referenceStartIndex = expression.indexOf("rankingExpression(")) >= 0) {
            int referenceEndIndex = expression.indexOf(")", referenceStartIndex);
            expression = expression.substring(0, referenceStartIndex) +
                         resolve(lookup(expression.substring(referenceStartIndex + "rankingExpression(".length(), referenceEndIndex), ranking), ranking) +
                         expression.substring(referenceEndIndex + 1);
        }
        return expression;
    }
Recursively resolves references to other ranking expressions - rankingExpression(name) -
and replaces the reference by the expression
config-model/src/test/java/com/yahoo/schema/derived/GeminiTestCase.java