Introspector { public static Map<String, Class<?>> getPropertyTypeMap(Class<?> clazz) { return getPropertyTypeMap(clazz, "class"); } private  Introspector(); static Map<String, Class<?>> getPropertyTypeMap(Class<?> clazz); static Map<String, Class<?>> getPropertyTypeMap(Class<?> clazz, String... exclude); static Map<String, Object> read(Object object); static List<Field> getAnnotatedFields(Class<?> clazz, Class<? extends Annotation> annotation); static Field getOpenEngSBModelIdField(Class<?> modelClass); static String getOpenEngSBModelIdProperty(Class<?> modelClass); static boolean isModel(Object object); static boolean isModelClass(Class<?> clazz);  }
@Test public void getPropertyTypeMap_returnsCorrectPropertyMap() throws Exception { Map<String, Class<?>> map = Introspector.getPropertyTypeMap(TestModel.class); assertEquals(4, map.size()); assertEquals(List.class, map.get("openEngSBModelTail")); assertEquals(String.class, map.get("testId")); assertEquals(Integer.class, map.get("testInteger")); assertEquals(SubTestModel.class, map.get("subModel")); }
@Test public void getPropertyTypeMap_withExclude_returnsCorrectPropertyMap() throws Exception { Map<String, Class<?>> map = Introspector.getPropertyTypeMap(TestModel.class, "class", "openEngSBModelTail"); assertEquals(3, map.size()); assertEquals(String.class, map.get("testId")); assertEquals(Integer.class, map.get("testInteger")); assertEquals(SubTestModel.class, map.get("subModel")); }