title: Prevent Kotlin from forcing Java to see a wildcard type
body: <p>This works fine:</p>
  
  <pre><code>class Wrapped&lt;out T&gt;(val value: T)
  
  open class Wrapper&lt;T&gt; {
      fun wrap(map: T): Wrapped&lt;T&gt; = Wrapped(map)
  }
  
  class Wrapper2 : Wrapper&lt;Map&lt;String, String&gt;&gt;()
  
  val wrapped: Wrapped&lt;Map&lt;String, String&gt;&gt; = Wrapper2().wrap(mapOf())
  </code></pre>
  
  <p>But, when I try to access <code>Wrapper2.wrap</code> from Java, the Map comes back with a wildcard type:</p>
  
  <pre class="lang-java prettyprint-override"><code>    Map&lt;String, String&gt; toWrap = new HashMap&lt;&gt;();
      Wrapped&lt;Map&lt;String, String&gt;&gt; result;
      result = new Wrapper&lt;Map&lt;String, String&gt;&gt;().wrap(toWrap); // ok
      result = new Wrapper2().wrap(toWrap); // NOT ok, returns Wrapped&lt;Map&lt;String, ? extends String&gt;&gt;
  </code></pre>
  
  <p>I can work around this by overriding <code>wrap</code> in <code>Wrapper2</code> with the explicit type.</p>
  
  <p>Why does <code>Wrapper2.wrap</code> return a different type than <code>Wrapper.wrap</code>?</p>