return cacheQuery;
}
private void assertQueryReturns(CacheQuery cacheQuery, Object[] expected) {
assertQueryListContains(cacheQuery.list(), expected);
final ResultIterator eagerIterator = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.EAGER));
try {
assertQueryIteratorContains(eagerIterator, expected);
}
finally {
eagerIterator.close();
}
final ResultIterator lazyIterator = cacheQuery.iterator(new FetchOptions().fetchMode(FetchOptions.FetchMode.LAZY));
try {
assertQueryIteratorContains(lazyIterator, expected);
}
finally {
lazyIterator.close();