public Struct instance(BoundField field) {
        validateField(field);
        if (field.def.type instanceof Schema) {
            return new Struct((Schema) field.def.type);
        } else if (field.def.type.isArray()) {
            return new Struct((Schema) field.def.type.arrayElementType().get());
        } else {
            throw new SchemaException("Field '" + field.def.name + "' is not a container type, it is of type " + field.def.type);
        }
    }
Create a struct for the schema of a container type (struct or array). Note that for array type, this method
assumes that the type is an array of schema and creates a struct of that schema. Arrays of other types can't be
instantiated with this method.

@param field The field to create an instance of
@return The struct
@throws SchemaException If the given field is not a container type
clients/src/main/java/org/apache/kafka/common/protocol/types/Struct.java