code: public void addChannelToCache(Channel channel) {
          Channel oldChannel = channels.put(channel.getId(), channel);
          if (oldChannel != channel && oldChannel instanceof Cleanupable) {
              ((Cleanupable) oldChannel).cleanup();
          }
      }
docs: Adds a channel to the cache.
  
  @param channel The channel to add.