MappingUtils { public static Class<?> getRealClass(Class<?> clazz, BeanContainer beanContainer) { DozerProxyResolver proxyResolver = beanContainer.getProxyResolver(); return proxyResolver.getRealClass(clazz); } private  MappingUtils(); static String getClassNameWithoutPackage(Class<?> clazz); static boolean isSupportedCollection(Class<?> aClass); static boolean isSupportedMap(Class<?> aClass); static void throwMappingException(Throwable e); static void throwMappingException(String msg); static void throwMappingException(String msg, Throwable cause); static boolean isBlankOrNull(String value); static Throwable getRootCause(Throwable ex); static String getMappedParentFieldKey(Object destObj, FieldMap destFieldMap); static Class<?> findCustomConverter(Cache converterByDestTypeCache, CustomConverterContainer customConverterContainer,
                                               Class<?> srcClass, Class<?> destClass); static Class<?> determineCustomConverter(FieldMap fieldMap, Cache converterByDestTypeCache,
                                                    CustomConverterContainer customConverterContainer, Class<?> srcClass, Class<?> destClass); static void reverseFields(FieldMap source, FieldMap reversed); static void reverseFields(ClassMap source, ClassMap destination, BeanContainer beanContainer); static Object getIndexedValue(Object collection, int index); static void applyGlobalCopyByReference(Configuration globalConfig, FieldMap fieldMap, ClassMap classMap); static Class<?> loadClass(String name, BeanContainer beanContainer); static Class<?> getRealClass(Class<?> clazz, BeanContainer beanContainer); static T deProxy(T object, BeanContainer beanContainer); static boolean isProxy(Class<?> clazz, BeanContainer beanContainer); static Object prepareIndexedCollection(Class<?> collectionType, Object existingCollection, Object collectionEntry,
                                                  int index); static boolean isDeepMapping(String mapping); static boolean isEnumType(Class<?> srcFieldClass); static boolean isEnumType(Class<?> srcFieldClass, Class<?> destFieldType); static List<Class<?>> getSuperClassesAndInterfaces(Class<?> srcClass, BeanContainer beanContainer); @SuppressWarnings("unchecked") static List<Class<?>> getInterfaceHierarchy(Class<?> srcClass, BeanContainer beanContainer);  }
@Test public void testGetRealClass() { Object proxyObj = ProxyDataObjectInstantiator.INSTANCE.newInstance(ArrayList.class); assertEquals(ArrayList.class, MappingUtils.getRealClass(proxyObj.getClass(), beanContainer)); assertEquals(ArrayList.class, MappingUtils.getRealClass(ArrayList.class, beanContainer)); }
@Test public void testGetRealClass_CGLIBTarget() { Object proxyObj = ProxyDataObjectInstantiator.INSTANCE.newInstance(new Class[] {List.class}, new ArrayList()); assertSame(proxyObj.getClass(), MappingUtils.getRealClass(proxyObj.getClass(), beanContainer)); }