@Test
    public void test_setCallback_given_unsupportedOperation() {
        //init
        Object data = new Object();
        JSONPathSegmentIndex segment = new JSONPathSegmentIndex(6);
        final JSONPath.Context context = new JSONPath.Context(JSONPath.of("$", Integer.TYPE), null, segment, null, 0);
        context.root = data;

        //test
        assertThrows(JSONException.class, () -> {
            //call
            segment.setCallback(context, (obj, v) -> {
                return v;
            });
        });

        //clear
        data = null;
    }
description: setCallback method test
fix: bug when index less than 0
core/src/test/java/com/alibaba/fastjson2/JSONPathSegmentIndexTest1.java