GeneratorUtils { public static boolean shouldIgnoreField(String fieldName, Class<?> srcType, Class<?> destType, BeanContainer beanContainer) { if (CLASS.equals(fieldName)) { return true; } return (CALLBACK.equals(fieldName) || CALLBACKS.equals(fieldName)) && (MappingUtils.isProxy(srcType, beanContainer) || MappingUtils.isProxy(destType, beanContainer)); } private  GeneratorUtils(); static boolean shouldIgnoreField(String fieldName, Class<?> srcType, Class<?> destType, BeanContainer beanContainer); static void addGenericMapping(MappingType mappingType, ClassMap classMap,
                                         Configuration configuration, String srcName, String destName, BeanContainer beanContainer,
                                         DestBeanCreator destBeanCreator, PropertyDescriptorFactory propertyDescriptorFactory);  }
@Test public void ignoreTechnicalFields() { Object proxy = ProxyDataObjectInstantiator.INSTANCE.newInstance(Object.class); BeanContainer beanContainer = new BeanContainer(); assertTrue(GeneratorUtils.shouldIgnoreField("callback", proxy.getClass(), Object.class, beanContainer)); assertFalse(GeneratorUtils.shouldIgnoreField("callback", Object.class, Object.class, beanContainer)); assertTrue(GeneratorUtils.shouldIgnoreField("callbacks", proxy.getClass(), Object.class, beanContainer)); assertFalse(GeneratorUtils.shouldIgnoreField("callbacks", Object.class, Object.class, beanContainer)); assertTrue(GeneratorUtils.shouldIgnoreField("class", Object.class, Object.class, beanContainer)); assertFalse(GeneratorUtils.shouldIgnoreField("a", proxy.getClass(), Object.class, beanContainer)); }