public static JavaBeanDescriptor serialize(Object obj) {
        return serialize(obj, JavaBeanAccessor.FIELD);
    }
@Test
    void testBeanSerialize() {
        Bean bean = new Bean();
        bean.setDate(new Date());
        bean.setStatus(PersonStatus.ENABLED);
        bean.setType(Bean.class);
        bean.setArray(new Phone[] {});

        Collection<Phone> collection = new ArrayList<Phone>();
        bean.setCollection(collection);
        Phone phone = new Phone();
        collection.add(phone);

        Map<String, FullAddress> map = new HashMap<String, FullAddress>();
        FullAddress address = new FullAddress();
        map.put("first", address);
        bean.setAddresses(map);

        JavaBeanDescriptor descriptor = JavaBeanSerializeUtil.serialize(bean, JavaBeanAccessor.METHOD);
        Assertions.assertTrue(descriptor.isBeanType());
        assertEqualsPrimitive(bean.getDate(), descriptor.getProperty("date"));
        assertEqualsEnum(bean.getStatus(), descriptor.getProperty("status"));
        Assertions.assertTrue(((JavaBeanDescriptor) descriptor.getProperty("type")).isClassType());
        Assertions.assertEquals(
                Bean.class.getName(), ((JavaBeanDescriptor) descriptor.getProperty("type")).getClassNameProperty());
        Assertions.assertTrue(((JavaBeanDescriptor) descriptor.getProperty("array")).isArrayType());
        Assertions.assertEquals(0, ((JavaBeanDescriptor) descriptor.getProperty("array")).propertySize());

        JavaBeanDescriptor property = (JavaBeanDescriptor) descriptor.getProperty("collection");
        Assertions.assertTrue(property.isCollectionType());
        Assertions.assertEquals(1, property.propertySize());
        property = (JavaBeanDescriptor) property.getProperty(0);
        Assertions.assertTrue(property.isBeanType());
        Assertions.assertEquals(Phone.class.getName(), property.getClassName());
        Assertions.assertEquals(0, property.propertySize());

        property = (JavaBeanDescriptor) descriptor.getProperty("addresses");
        Assertions.assertTrue(property.isMapType());
        Assertions.assertEquals(bean.getAddresses().getClass().getName(), property.getClassName());
        Assertions.assertEquals(1, property.propertySize());

        Map.Entry<Object, Object> entry = property.iterator().next();
        Assertions.assertTrue(((JavaBeanDescriptor) entry.getKey()).isPrimitiveType());
        Assertions.assertEquals("first", ((JavaBeanDescriptor) entry.getKey()).getPrimitiveProperty());

        Assertions.assertTrue(((JavaBeanDescriptor) entry.getValue()).isBeanType());
        Assertions.assertEquals(FullAddress.class.getName(), ((JavaBeanDescriptor) entry.getValue()).getClassName());
        Assertions.assertEquals(0, ((JavaBeanDescriptor) entry.getValue()).propertySize());
    }