fn exist_and_no_exchange_before( plan: &BatchPlanRef, is_candidate: fn(&BatchPlanRef) -> bool, ) -> bool