@Test
    public void testGetField() throws Exception {
        {
            Method getId = Bean3.class.getMethod("getId");
            Field field = BeanUtils.getField(Bean3.class, getId);
            assertNotNull(field);
        }
        {
            Method setId = Bean3.class.getMethod("setId", int.class);
            Field field = BeanUtils.getField(Bean3.class, setId);
            assertNotNull(field);
        }
        {
            Method isFlag = Bean3.class.getMethod("isFlag");
            Field field = BeanUtils.getField(Bean3.class, isFlag);
            assertNotNull(field);
        }
        {
            Method setFlag = Bean3.class.getMethod("setFlag", boolean.class);
            Field field = BeanUtils.getField(Bean3.class, setFlag);
            assertNotNull(field);
        }
        {
            Method getName = Bean3.class.getMethod("getName");
            Field field = BeanUtils.getField(Bean3.class, getName);
            assertNotNull(field);
        }
        {
            Method setName = Bean3.class.getMethod("setName", String.class);
            Field field = BeanUtils.getField(Bean3.class, setName);
            assertNotNull(field);
        }
    }
note

@author kon, created on 2022/4/27T11:04.
@version 1.0.0-SNAPSHOT
core/src/test/java/com/alibaba/fastjson2/util/BeanUtilsTest.java