     }
 
     private func channelRemoved0(_ channel: Channel) {
-        assert(self.eventLoop.inEventLoop)
+        self.eventLoop.assertInEventLoop()
         precondition(self.openChannels.keys.contains(ObjectIdentifier(channel)),
                      "channel \(channel) not in ChannelCollector \(self.openChannels)")
 

    /// - parameters:
    ///   - channel: The `Channel` to add to the `ChannelCollector`.
    func channelAdded(_ channel: Channel) throws {
        assert(self.eventLoop.inEventLoop)

        guard self.lifecycleState != .shutdownCompleted else {
            channel.close(promise: nil)

    }

    private func shutdownCompleted() {
        self.eventLoop.assertInEventLoop()
        assert(self.lifecycleState == .shuttingDown)

        self.lifecycleState = .shutdownCompleted
