title: How to implement the same interface multiple times, but with different generics?
body: <p>I have the following interface, which I want to implement multiple times in my classes:</p>
  
  <pre><code>public interface EventListener&lt;T extends Event&gt;
  {
      public void onEvent(T event);
  }
  </code></pre>
  
  <p>Now, I want to be able to implement this interface in the following way:</p>
  
  <pre><code>class Foo implements EventListener&lt;LoginEvent&gt;, EventListener&lt;LogoutEvent&gt;
  {
  
      @Override
      public void onEvent(LoginEvent event)
      {
  
      }
  
      @Override
      public void onEvent(LogoutEvent event)
      {
  
      }
  }
  </code></pre>
  
  <p>However, this gives me the error: <code>Duplicate class com.foo.EventListener</code> on the line:</p>
  
  <pre><code>class Foo implements EventListener&lt;LoginEvent&gt;, EventListener&lt;LogoutEvent&gt;
  </code></pre>
  
  <p>Is it possible to implement the interface twice with different generics? If not, what's the next closest thing I can do to achieve what I'm trying to do here?</p>