code for class snapshot and added testcases in testcrud method