try {
beanWithWriteReplace.getClass().getDeclaredMethod("writeReplace");
} catch (NoSuchMethodException e) {
fail("Bean should declare a writeReplace method");
}
Object proxy = ResultObjectProxy.createProxy(beanWithWriteReplace, new ResultLoaderMap(), true, 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;