AbstractBeanInspector implements Serializable { <T> BeanMetadata inspectBean(Class<T> beanClass) { logger.debug("Strarting analysis of " + beanClass.toString()); try { boolean isImmutable = !BeanClassUtils.hasDefaultConstructor(beanClass); BeanMetadata ret = new BeanMetadata(isImmutable); if (isImmutable) { inspectImmutableBean(beanClass, ret); } else { inspectMutableBean(beanClass, ret); } extractLifecycleHandlerMethods(beanClass, ret); String[] sourceBeanNames = readSourceBeanNames(beanClass); ret.setDefaultBeanNames(sourceBeanNames); return ret; } catch (Exception ex) { logger.error("Error while inspecting bean" + beanClass.toString(), ex); throw new RuntimeException("Could not inspect bean", ex); } }    }
@Test public void testPropertyDiscovery() { inspectBean(SimpleEntity.class); assertTrue(discoveredProperties.contains("aString")); assertTrue(discoveredProperties.contains("anInt")); assertTrue(discoveredProperties.contains("aDouble")); assertTrue(discoveredProperties.contains("aBoolean")); }