code: public <L extends Listener> void popEvent(Event<?, L> expected) {
          synchronized (this.stack) {
              final Event<?, ?> actual = this.stack.pop();
              if (actual != expected) {
                  throw new IllegalStateException(String.format(
                          "Unbalanced pop: expected '%s' but encountered '%s'",
                          expected.getListenerClass(), actual));
              }
          }
      }
docs: Pops the top event off the current event stack. This action has to be
  performed immediately after the event has been dispatched to all
  listeners.
  
  @param <L> Type of the listener.
  @param expected The Event which is expected at the top of the stack.
  @see #pushEvent(Event)