code: def test_serialize_legacy_fields(self):
      x = cellprofiler_core.image.ImageSetList()
      for i in range(5):
          x.get_image_set(i)
      d = {"foo": "bar", "test": "suite"}
      x.legacy_fields["dictionary"] = d
      s = x.save_state()
  
      y = cellprofiler_core.image.ImageSetList()
      y.load_state(s)
      assert y.count() == 5
      assert "dictionary" in y.legacy_fields
      for key in list(d.keys()):
          assert key in y.legacy_fields["dictionary"]
          assert y.legacy_fields["dictionary"][key] == d[key]
  
file_path: CellProfiler/tests/core/image/test_image_set_list.py
imports: import numpy
  import cellprofiler_core.image
  import cellprofiler_core.image.abstract_image._callback_image
label_desc: Use image node_id 9 for calling the TestImageSetList obj's underlying member method code with example usage: obj.test_serialize_legacy_fields() without return types