Collections.Set
Purpose
Section titled “Purpose”Uniqueness-preserving collection for membership operations.
Candidate surface
Section titled “Candidate surface”Set<T>.Add(T value) -> boolSet<T>.Contains(T value) -> boolSet<T>.Remove(T value) -> bool
- Equality semantics must match
Mapkey semantics. - Capacity behavior should be explicit for performance-sensitive code.