def METHOD_NAME(RE, hw):
    """Test on nested runs (using decorator on each plan)"""
    dc = DocCollector()
    to_read = (hw.motor, hw.det)
    def some_plan():
        """This plan is called on each level of nesting"""
        for j in range(5):
            yield from bps.mov(hw.motor, j)
            yield from bps.trigger_and_read(to_read)
    @bsp.set_run_key_decorator("run_one")
    @bsp.run_decorator(md={})
    def plan_inner():
        yield from bps.declare_stream(*to_read, name='primary')
        yield from some_plan()
    @bsp.set_run_key_decorator("run_two")
    @bsp.run_decorator(md={})
    def plan_middle():
        yield from bps.declare_stream(*to_read, name='primary')
        yield from some_plan()
        yield from plan_inner()
    @bsp.set_run_key_decorator(run="run_three")  # Try kwarg
    @bsp.run_decorator(md={})
    def plan_outer():
        yield from bps.declare_stream(*to_read, name='primary')
        yield from some_plan()
        yield from plan_middle()
    RE(plan_outer(), dc.insert)
    assert len(dc.start) == 3
    for start in dc.start:
        desc, = dc.descriptor[start["uid"]]
        assert len(dc.event[desc["uid"]]) == 5
    for stop in dc.stop.values():
        for start in dc.start:
            assert start["time"] < stop["time"]