public static Map<String, String> objectToMap(Object object) {
        if (object == null) {
            return null;
        }
        Map<String, String> map = new HashMap<>(16);
        Field[] fields = object.getClass().getDeclaredFields();
        try {
            for (Field field : fields) {
                boolean accessible = field.isAccessible();
                field.setAccessible(true);
                if (field.getType() == Date.class) {
                    Date date = (Date) field.get(object);
                    if (date != null) {
                        map.put(field.getName(), String.valueOf(date.getTime()));
                    }
                } else {
                    map.put(field.getName(),
                            field.get(object) == null ? "" : field.get(object).toString());
                }
                field.setAccessible(accessible);
            }
        } catch (IllegalAccessException e) {
            throw new NotSupportYetException(
                    "object " + object.getClass().toString() + " to map failed:" + e.getMessage());
        }
        return map;
    }
@Test
    public void testObjectToMap() {
        BranchDO branchDO = new BranchDO("xid123123", 123L, 1, 2.2, new Date());
        Map<String, String> map = BeanUtils.objectToMap(branchDO);
        Assertions.assertEquals(branchDO.getXid(), map.get("xid"));
        Assertions.assertEquals(branchDO.getTransactionId(), Long.valueOf(map.get("transactionId")));
        Assertions.assertEquals(branchDO.getStatus(), Integer.valueOf(map.get("status")));
        Assertions.assertEquals(branchDO.getTest(), Double.valueOf(map.get("test")));
        Assertions.assertEquals(branchDO.getGmtCreate().getTime(),Long.valueOf(map.get("gmtCreate")));

        Assertions.assertNull(BeanUtils.objectToMap(null));

        // date is null / field is null
        branchDO = new BranchDO("xid123123", null, 1, 2.2, null);
        map = BeanUtils.objectToMap(branchDO);
        Assertions.assertNull(map.get("gmtCreate"));
        Assertions.assertEquals("", map.get("transactionId"));
    }