absorptionIntersection<T> static method

bool absorptionIntersection<T>(
  1. CustomSet<T> a,
  2. CustomSet<T> b
)

Verifies the Absorption Law for Intersection.

Law: A ∩ (A ∪ B) = A

The intersection of a set with its union with another set equals the original set.

Implementation

static bool absorptionIntersection<T>(CustomSet<T> a, CustomSet<T> b) {
  final union = SetOperations.union(a, b);
  return SetOperations.intersection(a, union).equals(a);
}