def METHOD_NAME(tmpdir_factory, nwbfile):
    tmpdir = str(tmpdir_factory.mktemp("test_serialize"))
    first_path = os.path.join(tmpdir, "first.nwb")
    second_path = os.path.join(tmpdir, "second.nwb")
    with pynwb.NWBHDF5IO(first_path, "w") as writer:
        writer.write(nwbfile)
    sink = nwb2_sink.Nwb2Sink(first_path)
    sink.register("institution", "AIBS")
    sink.serialize({"output_path": second_path})
    with pynwb.NWBHDF5IO(second_path, "r", load_namespaces=True) as reader:
        obt = reader.read()
        assert obt.institution == "AIBS"