def METHOD_NAME(project_with_runs, with_injection):
    """Test getting the latest version of a plan."""
    with with_injection():
        plan_gateway = get_plan_gateway()
        plan = next(p for p in plan_gateway.get_all_plans() if p.name == "plan-1")
        newer_plan = plan.derive()
        plan_gateway.add(newer_plan)
        project_context.database.commit()
    latest_version = Plan.from_plan(plan).get_latest_version()
    assert plan.id != latest_version.id
    assert newer_plan.id == latest_version.id
    plan = next(p for p in Plan.list() if p.name == "plan-2")
    latest_version = plan.get_latest_version()
    assert plan is latest_version