public static String asImage(Object obj) {
        if (!(obj instanceof String)) {
            return obj.toString();
        }
        return UnicodeUtilities.quote((String)obj, '"');
    }
Returns a string representation of an object that can be used in the 'image' constructor argument of {@link
GroupingNode}. This method ensures that strings are quoted, and that all complex characters are escaped.

@param obj The object to output.
@return The string representation.
container-search/src/main/java/com/yahoo/search/grouping/request/GroupingExpression.java