Added class methods query and tests.