diff --git a/transport/src/main/java/io/netty/channel/nio/SelectedSelectionKeySet.java b/transport/src/main/java/io/netty/channel/nio/SelectedSelectionKeySet.java
--- a/transport/src/main/java/io/netty/channel/nio/SelectedSelectionKeySet.java
+++ b/transport/src/main/java/io/netty/channel/nio/SelectedSelectionKeySet.java
@@ -20,6 +20,7 @@
 import java.util.Arrays;
 import java.util.Iterator;
 import java.util.NoSuchElementException;
+import java.util.Objects;
 
 final class SelectedSelectionKeySet extends AbstractSet<SelectionKey> {
 
@@ -51,6 +52,13 @@ public boolean remove(Object o) {
 
     @Override
     public boolean contains(Object o) {
+        SelectionKey[] array = keys;
+        for (int i = 0, s = size; i < s; i++) {
+            SelectionKey k = array[i];
+            if (k.equals(o)) {
+                return true;
+            }
+        }
         return false;
     }
 

diff --git a/transport/src/test/java/io/netty/channel/nio/SelectedSelectionKeySetTest.java b/transport/src/test/java/io/netty/channel/nio/SelectedSelectionKeySetTest.java
--- a/transport/src/test/java/io/netty/channel/nio/SelectedSelectionKeySetTest.java
+++ b/transport/src/test/java/io/netty/channel/nio/SelectedSelectionKeySetTest.java
@@ -102,8 +102,8 @@ public void contains() {
         SelectedSelectionKeySet set = new SelectedSelectionKeySet();
         assertTrue(set.add(mockKey));
         assertTrue(set.add(mockKey2));
-        assertFalse(set.contains(mockKey));
-        assertFalse(set.contains(mockKey2));
+        assertTrue(set.contains(mockKey));
+        assertTrue(set.contains(mockKey2));
         assertFalse(set.contains(mockKey3));
     }
 

Possible issues with SelectedSelectionKeySet in non-linux operating systems
`SelectedSelectionKeySet` doesn't implement `contains()` method. Or at least it returns always false. This may create issues in non-linux operating systems.

To give you more context, in my work, like you do, we try to not produce garbage by replacing `HashSet` with something similar to `SelectedSelectionKeySet`. Actually this trick is something we learned from netty.

So while investigating a recent bug, I realized lack of correct implementation of `contains()` method creates problems in macos (and very possibly windows as well). I tried to summarize my finding in here: https://github.com/hazelcast/hazelcast/pull/24267

I do think this issue effects netty as well.

Good find, we'll take a look.
org.io.netty.channel.nio.SelectedSelectionKeySetTest