added Query class and its testcase