Improve equals method in QueryValidator
Add query test cases for filtering