subQuery = QueryFactory.newReportQuery(Article.class, subCrit);
subQuery.setAttributes(new String[]{"count(productGroupId)"});
// mkalen: if using String("10") instead of Integer below,
// PostgreSQL will return 7 (sic!) groups
crit.addGreaterThan(subQuery, new Integer(10)); // MORE than 10 articles
crit.addLessThan("groupId", PGROUP_ID_HI_WATERMARK);
Query q = QueryFactory.newQuery(ProductGroup.class, crit);
Collection results = broker.getCollectionByQuery(q);
assertNotNull(results);