ConcreteObject proxy2 = (ConcreteObject)WicketObjects.cloneObject(proxy);
assertTrue(proxy != proxy2);
assertEquals(proxy2.getMessage(), "concrete");
// test equals/hashcode method interception
final IObjectMethodTester tester = new ObjectMethodTester();
assertTrue(tester.isValid());
IProxyTargetLocator testerLocator = new IProxyTargetLocator()
{
private static final long serialVersionUID = 1L;
public Object locateProxyTarget()
{
return tester;
}
};
ObjectMethodTester testerProxy = (ObjectMethodTester)LazyInitProxyFactory.createProxy(
ObjectMethodTester.class, testerLocator);
testerProxy.equals(this);
testerProxy.hashCode();
testerProxy.toString();
assertTrue(tester.isValid());
}