title: Dynamically remove a @EventListener in Spring
body: <p>I want to remove or add Spring ApplicationListeners dynamically in my (test) code.</p>
  <p>Using Spring's <code>ApplicationEventMulticaster</code> as outlined in this <a href="https://stackoverflow.com/questions/15930254/best-practice-for-dynamically-removing-a-spring-applicationlistener">question</a> would work for me,
  however the specific <code>ApplicationListener</code> I'm interested in is implemented using an <code>@EventListener</code> annotated method, which results in an <code>ApplicationListenerMethodAdapter</code>-Object at runtime.</p>
  <p>How can I get hold of the name of this bean, so that I can remove the bean with the <code>ApplicationEventMulticaster</code>?</p>
  <pre><code>eventMulticaster.removeApplicationListenerBean(&quot;NAME_OF_APPLICATION_METHOD_ADAPTER_BEAN&quot;)
  </code></pre>