@Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }

        // FIXME: a hack to make org.apache.dubbo.remoting.exchange.support.DefaultFuture.closeChannel work
        if (obj instanceof NettyClient) {
            NettyClient client = (NettyClient) obj;
            return channel.equals(client.getNettyChannel());
        }

        if (getClass() != obj.getClass()) {
            return false;
        }
        NettyChannel other = (NettyChannel) obj;
        if (channel == null) {
            if (other.channel != null) {
                return false;
            }
        } else if (!channel.equals(other.channel)) {
            return false;
        }
        return true;
    }
@Test
    void testEquals() {
        Channel channel2 = Mockito.mock(Channel.class);
        NettyChannel nettyChannel = NettyChannel.getOrAddChannel(channel, url, channelHandler);
        NettyChannel nettyChannel2 = NettyChannel.getOrAddChannel(channel2, url, channelHandler);
        Assertions.assertEquals(nettyChannel, nettyChannel);
        Assertions.assertNotEquals(nettyChannel, nettyChannel2);
    }