query.setCacheStrategy(QueryCacheStrategy.SHARED_CACHE);
query.setPageSize(5);
QueryCache cache = domain.queryCache;
domain.queryCache = new MockQueryCache() {
@Override
public List get(QueryMetadata metadata, QueryCacheEntryFactory factory) {
Object results = factory.createObject();
assertTrue("Query cache is not serializable.", results instanceof Serializable);