Add a test for the pickle functionality.