def METHOD_NAME(project_with_runs, with_injection):
    """Test Plan.list returns the latest versions of plans."""
    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()
    plans = Plan.list()
    ids = [p.id for p in plans]
    assert newer_plan.id in ids
    assert plan.id not in ids