try {
beanWithWriteReplace.getClass().getDeclaredMethod("writeReplace");
} catch (NoSuchMethodException e) {
fail("Bean should declare a writeReplace method");
}
Object proxy = proxyFactory.createProxy(beanWithWriteReplace, new ResultLoaderMap(), new Configuration(), new DefaultObjectFactory(), new ArrayList<Class<?>>(), new ArrayList<Object>());
Class<?>[] interfaces = proxy.getClass().getInterfaces();
boolean ownInterfaceFound = false;
for (Class<?> i : interfaces) {
if (i.equals(WriteReplaceInterface.class)) {
ownInterfaceFound = true;