add tests for some methods of InstanceImpl class.