Collection result = (Collection) query.execute();
assertEquals(1, result.size());
Book b = (Book) result.iterator().next();
CollectionProxy handler = ProxyHelper.getCollectionProxy(b.getReviews());
assertFalse("Don't expect an materialized collection proxy", handler.isLoaded());
handler.addListener(new CollectionProxyListener()
{
public void beforeLoading(CollectionProxyDefaultImpl colProxy)
{
fail("Collection proxy shouldn't be materialized");
}