protected void renderGroupMetadata(GroupId id) throws IOException {
        if (!(id instanceof ValueGroupId<?> || id instanceof BucketGroupId)) return;

        if (id instanceof ValueGroupId<?> valueId) {
            generator.writeStringField(GROUPING_VALUE, valueId.getValue().toString());
        } else {
            BucketGroupId<?> bucketId = (BucketGroupId<?>) id;
            generator.writeObjectFieldStart(BUCKET_LIMITS);
            generator.writeStringField(BUCKET_FROM, bucketId.getFrom().toString());
            generator.writeStringField(BUCKET_TO, bucketId.getTo().toString());
            generator.writeEndObject();
        }
    }
Creates a json renderer using a custom executor.
Using a custom executor is useful for tests to avoid creating new threads for each renderer registry.
container-search/src/main/java/com/yahoo/search/rendering/JsonRenderer.java