asSet method

Set<E> asSet()

Returns as an immutable set.

Useful when producing or using APIs that need the Set interface. This differs from toSet where mutations are explicitly disallowed.

Implementation

Set<E> asSet() => UnmodifiableSetView<E>(_set);