class Fastjson2Serializer implements StringSerializer {
    ObjectWriterProvider config;
    JSONWriter.Feature[] features;
    JSONWriter.Context writeContext;

    protected Fastjson2Serializer(ObjectWriterProvider config, JSONWriter.Feature... features) {
        this.features = features;

        if (config != null) {
            this.config = config;
            this.writeContext = new JSONWriter.Context(config, features);
        }
    }

    @Override
    public String serialize(Object obj) throws IOException {<FILL_FUNCTION_BODY>}
}

        if (config == null) {
            return JSON.toJSONString(obj, features);
        } else {
            return JSON.toJSONString(obj, writeContext);
        }
    
<no_super_class>