if ( key == null || c.getIds( key ) == null || c.getIds( key ).size() == 0) { log.warn( " Skipping "+key+" in collection counts."); continue; }
    private void collectCounts(Collection queryResults, PojoOptions po)    {        if (po.hasCountFields() && po.isCounts())        {            CountCollector c = new CountCollector(po.countFields());            c.collect(queryResults);            for (String key : po.countFields())            {                Query q_c = queryFactory.lookup(                        /* TODO po.map() here */                        CollectionCountQueryDefinition.class.getName(),                        PojosQP.String("field",key),                        PojosQP.ids(c.getIds(key))                        );                List l_c = (List) iQuery.execute(q_c);                for (Object o : l_c)                {                   Object[] results = (Object[]) o;                   Long id = (Long) results[0];                   Integer count = (Integer) results[1];                   c.addCounts(key,id,count);                }                            }        }    }