@Test
    public void test_setCallback_given_list_with_index_eq_minus1() {
        //init
        List<Integer> data = Lists.newArrayList(1, 2, 3, 4, 5);
        JSONPathSegmentIndex segment = JSONPathSegmentIndex.LAST;
        JSONPath.Context context = new JSONPath.Context(JSONPath.of("$", Integer.TYPE), null, segment, null, 0);
        context.root = data;

        //call
        segment.setCallback(context, (obj, v) -> {
            return ((List<Integer>) obj).get(0) + (Integer) v;
        });
        //test
        assertEquals(data.get(4), 6);

        //call
        segment.setCallback(context, (obj, v) -> {
            return ((List<Integer>) obj).get(4) + (Integer) v;
        });
        //test
        assertEquals(data.get(4), 12);

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