def METHOD_NAME(simulation_factory, polymer_snapshot_factory):
    """Test that md.constrain.Distance can be pickled and unpickled."""
    # detached
    d = hoomd.md.constrain.Distance(tolerance=1e-5)
    pickling_check(d)
    # attached
    sim = simulation_factory(polymer_snapshot_factory())
    integrator = hoomd.md.Integrator(dt=0.005)
    nve = hoomd.md.methods.ConstantVolume(filter=hoomd.filter.All())
    integrator.methods.append(nve)
    integrator.constraints.append(d)
    sim.run(0)
    pickling_check(d)