Implement the unserialize method and the corresponding tests