BeanUtilsExtended { @SuppressWarnings("unchecked") public static Map<String, String> buildStringAttributeMap(Object bean) throws IllegalArgumentException { try { return BeanUtils.describe(bean); } catch (Exception e) { ReflectionUtils.handleReflectionException(e); throw new IllegalStateException("Should never get here"); } } private  BeanUtilsExtended(); static Map<String, Object> buildObjectAttributeMap(Object bean); static BeanType createBeanFromAttributeMap(Class<BeanType> beanType,
            Map<String, ? extends Object> attributeValues); @SuppressWarnings("unchecked") static Map<String, String> buildStringAttributeMap(Object bean);  }
@Test public void testBuildAttributeMapFromSimpleStringBean_shouldReturnMapThatContainsProperties() throws Exception { SimpleBeanWithStrings testBean = new SimpleBeanWithStrings("foo", "bar"); Map<String, String> attributeMap = BeanUtilsExtended.buildStringAttributeMap(testBean); assertThat(attributeMap.get("value1"), is("foo")); assertThat(attributeMap.get("value2"), is("bar")); }