Qng and related test cases implemented.