Github user nickwallen commented on the issue:
The first point here is around semantics. I am assuming the semantics of
this would be a "max of maxes". So if I have a list of stats objects, I
compare the max of each one. Whichever max is the greatest, that stats object
gets returned. The MIN function would just be a "min of mins".
Does that match your use case? Is this the right approach?
Given those semantics, I think the 'Comparable' approach could work, but
with a twist. You can't just make the Stats objects Comparable. Because how
do you compare them? By the average, median, min or max? There is not one way
to do it that is broadly applicable.
The means of comparison for the MAX function should use the max of a stats
object. The means of comparison for the MIN function should use the min of the
One way is to create a class that wraps a Stats object and implements the
Comparable interface. In the case of MAX, the wrapper will compare using the
max of the underlying stats object. In the case of MIN function, the wrapper
will compare using the min of the underlying stats object.