code: public static void safelyRemoveHandlers(ChannelPipeline pipeline, String... handlerNames) {
          for (String name : handlerNames) {
              if (pipeline.get(name) != null) {
                  pipeline.remove(name);
              } else {
                  LOG.debug("Trying to remove not engaged {} handler from the pipeline", name);
              }
          }
      }
docs: Removes handlers from the pipeline if they are present.
  
  @param pipeline     the channel pipeline
  @param handlerNames names of the handlers to be removed