associativeIntersection<T> static method
Verifies the Associative Law for Intersection.
Law: A ∩ (B ∩ C) = (A ∩ B) ∩ C
The grouping of sets in an intersection operation does not matter.
Implementation
static bool associativeIntersection<T>(
CustomSet<T> a,
CustomSet<T> b,
CustomSet<T> c,
) {
final left = SetOperations.intersection(
a,
SetOperations.intersection(b, c),
);
final right = SetOperations.intersection(
SetOperations.intersection(a, b),
c,
);
return left.equals(right);
}