absorptionUnion<T> static method

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

Verifies the Absorption Law for Union.

Law: A ∪ (A ∩ B) = A

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

Implementation

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