From: Waldhoff, Rodney [mailto:[EMAIL PROTECTED]]

> I think we probably still want to think about the semantics of element
> cardinality a bit--e.g., currently if list A has 1 copies of 
> "foo", and list
> B has 3 copies of "foo", ListUtils.itersection(A,B) will 
> contain 3 copies,
> which doesn't seem quite right to me. 

Well, I guess it's a little hard to decide what is the "right" thing
when we talking about perform set operation on non-sets.

If they're ListUtils, then I would think it is reasonable to
return 3 copies of "foo", but I have one concern.

There should be a guarantee that:
        intersection(A,B) = intersection(B,A)

If intersection(A,B) is all things in A that exist in B, then
if A only has one "foo", then the result should only have 1 also.

However, the reverse [intersection(B,A)]  should have 3 "foo"s,
because there are 3 in B, and each one is in A.

Thus there is a contradiction.

I'm not sure which is the correct answer, unless you state that
the result is always a set, even if the inputs are not.

Reply via email to