Book b = (Book) result.iterator().next();
IndirectionHandler handler = ProxyHelper.getIndirectionHandler(b.getPublisher());
assertNotNull(handler);
assertFalse(handler.alreadyMaterialized());
handler.addListener(
new MaterializationListener()
{
public void beforeMaterialization(IndirectionHandler handler, Identity oid)
{
fail("Reference shall not materialize while locking");
}