title: Overriding Kotlin method with generic parameter in java - method clash
body: <p>My team is migrating to Kotlin for our Android app, but we still have lots of legacy java code, this causes weird code issues sometimes. This is one of those strange cases.</p>
  
  <p>I have a Kotlin class, call it MyInterface:</p>
  
  <pre><code>interface MyInterface {
      fun onMyObjectList(myObjectList: List&lt;MyObject&gt;)
  }
  </code></pre>
  
  <p>I need to implement this interface in an Activity, written in Java:</p>
  
  <pre><code>class MyActivity implements MyInterface {
  ...
  }
  </code></pre>
  
  <p>Here's how I implement the overridden method in Java:</p>
  
  <pre><code>@Override
  public void onMyObjectList(@NotNull List&lt;MyObject&gt; objectList) {
  
  }
  </code></pre>
  
  <p>I do want to get a <code>List&lt;MyObject&gt;</code> as a parameter, but the IDE throws an error</p>
  
  <blockquote>
    <p><code>onMyObjectList(List&lt;MyObject&gt; objectList)</code> in MyActivity clashes with <code>onMyObjectList(List&lt;? extends MyObject&gt; objectList)</code> in MyInterface. Both methods have the same erasure, yet neither overrides the other</p>
  </blockquote>
  
  <p>I can't use a <code>List&lt;? extends MyObject&gt;</code> as a parameter as I'm passing it further on to a method that expects a <code>List&lt;MyObject&gt;</code>. How can I configure my Kotlin interface so that it actually uses <code>List&lt;MyObject&gt;</code> instead of <code>List&lt;? extends MyObject&gt;</code> when overridden in Java?</p>