paulirwin commented on code in PR #1066:
URL: https://github.com/apache/lucenenet/pull/1066#discussion_r2354155407


##########
src/Lucene.Net.Tests.Grouping/DistinctValuesCollectorTest.cs:
##########
@@ -417,50 +411,183 @@ private void AddField(Document doc, string field, string 
value, DocValuesType ty
             doc.Add(valuesField);
         }
 
-        private 
IAbstractDistinctValuesCollector<AbstractDistinctValuesCollector.IGroupCount<T>>
 CreateDistinctCountCollector<T>(IAbstractFirstPassGroupingCollector<T> 
firstPassGroupingCollector,
+        // LUCENENET specific - wrapper class to adapt to a collector of 
IComparable group counts
+        private class ComparableDistinctValuesCollector<T, TGroupValue> : 
AbstractDistinctValuesCollector<ComparableGroupCount, IComparable>
+            where T : AbstractDistinctValuesCollector.GroupCount<TGroupValue>
+            where TGroupValue : IComparable
+        {
+            private readonly AbstractDistinctValuesCollector<T, TGroupValue> 
wrapped;
+
+            public 
ComparableDistinctValuesCollector(AbstractDistinctValuesCollector<T, 
TGroupValue> wrapped)
+            {
+                this.wrapped = wrapped;
+            }
+
+            public override IList<ComparableGroupCount> Groups
+                => wrapped.Groups.Select(group => new 
ComparableGroupCount(group.GroupValue, new 
JCG.HashSet<IComparable>(group.UniqueValues.Cast<IComparable>()))).ToList();

Review Comment:
   This is test code; I think LINQ here is okay.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscr...@lucenenet.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to