@Override
    public FunctionNode setChildren(List<ExpressionNode> children) {
        if (arguments.expressions().size() != children.size())
            throw new IllegalArgumentException("Expected " + arguments.expressions().size() + " children but got " + children.size());
        if (children.size() == 1)
            return new FunctionNode(function, children.get(0));
        else // binary
            return new FunctionNode(function, children.get(0), children.get(1));
    }
Returns a new function node with the children replaced by the given children
searchlib/src/main/java/com/yahoo/searchlib/rankingexpression/rule/FunctionNode.java