Java Generics: Method X is not applicable for the arguments
<p><strong>EventHandler.java:</strong></p>

<pre><code>public abstract class EventHandler&lt;E extends EventArgs&gt; { 
    public abstract void HandleEvent(Object sender, E e);
}
</code></pre>

<p><strong>Observers.java:</strong>  </p>

<pre><code>public class Observers&lt;E extends EventArgs&gt; {

    private CopyOnWriteArrayList&lt;EventHandler&lt;? extends E&gt;&gt; mListeners = new CopyOnWriteArrayList&lt;EventHandler&lt;? extends E&gt;&gt;();

    public void dispatchEvent(Object sender, E args) {
        if (mListeners != null) {
            for (EventHandler&lt;? extends E&gt; listener : mListeners) {
                listener.HandleEvent(sender, args);
            }
        }
    }
}
</code></pre>

<p>The following line:</p>

<pre><code>listener.HandleEvent(sender, args);
</code></pre>

<p>Causes:</p>

<blockquote>
  <p>The method HandleEvent(Object, capture#3-of ? extends E) in the type
  EventHandler is not applicable for the
  arguments (Object, E)</p>
</blockquote>

<p>Does anybody how to fix this?</p>

<p><strong>EDIT1</strong>
The reason <code>? super E</code> doesn't work for me is that I have the following method inside <code>Observers</code> class:</p>

<pre><code>public void addListener(EventHandler&lt;? super E&gt; listener) {
mListeners.add(listener);
}
</code></pre>

<p>And that causes:</p>

<blockquote>
  <p>The method add(EventHandler) in the type
  CopyOnWriteArrayList> is not applicable for the
  arguments (EventHandler)</p>
</blockquote>

<p><strong>EDIT2</strong></p>

<p>The reason the change from <code>? super E</code> to <code>E</code> doesn't work for me because of this:
<a href="http://stackoverflow.com/questions/8136302/x-is-not-applicable-for-the-arguments-y-when-x-extends-y">X is not applicable for the arguments Y, when X extends Y</a></p>

<p>It was already like that but that didn't work neither :(</p>
