def METHOD_NAME(plugin_registry):
    class LastPlugin:
        @hookimpl(trylast=True)
        def get_first_joke(self):
            return "last joke"
    class MiddlePlugin:
        @hookimpl
        def get_first_joke(self):
            return "middle joke"
    class FirstPlugin:
        @hookimpl(tryfirst=True)
        def get_first_joke(self):
            x = 1 + 1  # return nothing
    plugin_registry.load_plugin_with_hooks_impl(FirstPlugin(), "first")
    plugin_registry.load_plugin_with_hooks_impl(MiddlePlugin(), "middle")
    plugin_registry.load_plugin_with_hooks_impl(LastPlugin(), "last")
    assert plugin_registry.hook().get_first_joke() == "middle joke"