The CountBy method was added to the AbstractTableGateway class.