private static void renderGroupId(GroupId id, XMLWriter writer) {
        writer.openTag(TAG_GROUP_ID).attribute(ATR_TYPE, id.getTypeName());
        if (id instanceof ValueGroupId<?> valueGroupId) {
            writer.content(valueGroupId.getValue(), false);
        } else if (id instanceof BucketGroupId bucketId) {
            writer.openTag(TAG_BUCKET_FROM).content(bucketId.getFrom(), false).closeTag();
            writer.openTag(TAG_BUCKET_TO).content(bucketId.getTo(), false).closeTag();
        }
        writer.closeTag();
    }
Renders the header for the given grouping hit. If the hit is not a grouping hit, this method does nothing and
returns false.
<p>Post-condition if this is a grouping hit: The hit tag is open.

@param hit    The hit whose header to render.
@param writer The writer to render to.
@return True if the hit was rendered.
@throws IOException Thrown if there was a problem writing.
container-search/src/main/java/com/yahoo/search/grouping/result/HitRenderer.java