private static async Task <IGrouping <TKey, TElement> > AwaitGrouping <TKey, TElement>( IAsyncGrouping <TKey, TElement> asyncGrouping) { if (asyncGrouping is null) { throw new ArgumentNullException(nameof(asyncGrouping)); } var key = asyncGrouping.Key; var enumerable = await asyncGrouping.ConfigureAwait(false); return(new Grouping <TKey, TElement>(key, enumerable)); }