public static Map<String, Field> getBeanPropertyFields(Class cl) {
        Map<String, Field> properties = new HashMap<>();
        for (; cl != null; cl = cl.getSuperclass()) {
            Field[] fields = cl.getDeclaredFields();
            for (Field field : fields) {
                if (Modifier.isTransient(field.getModifiers()) || Modifier.isStatic(field.getModifiers())) {
                    continue;
                }

                field.setAccessible(true);

                properties.put(field.getName(), field);
            }
        }

        return properties;
    }
@Test
    void testGetBeanPropertyFields() {
        Map<String, Field> map = ReflectUtils.getBeanPropertyFields(EmptyClass.class);
        assertThat(map.size(), is(2));
        assertThat(map, hasKey("set"));
        assertThat(map, hasKey("property"));
        for (Field f : map.values()) {
            if (!f.isAccessible()) {
                fail();
            }
        }
    }