Test case for QueryImpl.equals