code: public void pushListener(Class<? extends ChainingListener> listenerClass)
      {
          if (StackableChainingListener.class.isAssignableFrom(listenerClass)) {
              Deque<ChainingListener> stack = this.listeners.get(listenerClass);
              stack.push(((StackableChainingListener) stack.peek()).createChainingListenerInstance());
          }
      }
docs: Create a new instance of the passed chaining listener if it's stackable (ie it implements the
  {@link org.xwiki.rendering.listener.chaining.StackableChainingListener} interface. This allows creating a clean
  state when some sub rendering has to be done with some new state.
  
  @param listenerClass the listener class for which to create a new instance (if stackable)