On Wed, 13 May 2026 16:45:15 GMT, Alan Bateman <[email protected]> wrote:

> Note that `contains(null)` will cause NPE on `Set.of` but `unmodifiableSet()` 
> result always return `false` (if you could migrate it to `Set.of`, which 
> filters null inputs)

Actually whether `UnmodifiableSet​::contains(null)` throws **NPE** depends on 
the backing `Set`’s implementation.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/31135#issuecomment-4444666629

Reply via email to