Added new count method into Query object and tested