generate sample object from class