def METHOD_NAME():
    def _toString(event):
        obj = event.info
        if isinstance(obj, set):
            event.addResponse(str(list(obj)))
    with girder.events.bound('rest.json_encode', 'toString', _toString):
        resource = TestResource()
        resp = resource.returnsSet().decode('utf8')
        assert json.loads(resp) == {'key': '[1, 2, 3]'}
        # Check we still get default encode for date
        resp = resource.returnsDate().decode('utf8')
        assert json.loads(resp) == {'key': date.replace(tzinfo=pytz.UTC).isoformat()}