static void removeChannelIfDisconnected(Channel ch) {
        if (ch != null && !ch.isConnected()) {
            ch.removeAttribute(CHANNEL_KEY);
        }
    }
@Test
    void removeChannelIfDisconnectedTest() {
        Assertions.assertNull(channel.getAttribute(CHANNEL_KEY));
        channel.setAttribute(CHANNEL_KEY, header);
        channel.close();
        HeaderExchangeChannel.removeChannelIfDisconnected(channel);
        Assertions.assertNull(channel.getAttribute(CHANNEL_KEY));
    }