Moved object discard to unit test file.