Eng 6695 partial agg for ordered subquery

You don't need containsKey. Just call get, then break if the result is null.