title: Type inference involving return type, wild card, and intersection type
body: <p>I'm trying to declare an interface that contains a method which will return a list of things that implement both <code>Comparator&lt;Object&gt;</code> and <code>Action</code>, i.e.</p>
  
  <pre><code>&lt;T extends Comparator&lt;Object&gt; &amp; Action&gt; List&lt;T&gt; getThings();
  </code></pre>
  
  <p>This compiles fine, but the problem comes when I try to call this method. I want to be able to do this:</p>
  
  <pre><code>List&lt;Action&gt; things = getThings();
  List&lt;Comparator&lt;Object&gt;&gt; things = getThings();
  </code></pre>
  
  <p>When I try to do this I get the following compilation error:</p>
  
  <pre><code> incompatible types; no instance(s) of type variable(s) T exist so that
   java.util.List&lt;T&gt; conforms to java.util.List&lt;javax.swing.Action&gt;
   found   : &lt;T&gt;java.util.List&lt;T&gt;
   required: java.util.List&lt;javax.swing.Action&gt;
  </code></pre>
  
  <p>The following doesn't work either:</p>
  
  <pre><code>List&lt;? extends Action&gt; things = getThings();
  List&lt;? extends Comparator&lt;Object&gt;&gt; things = getThings();
  </code></pre>
  
  <p>Another way to achieve this effect is to create an empty interface that extends both <code>Comparator&lt;Object&gt;</code> and <code>Action</code> and use that as the return type, i.e.</p>
  
  <pre><code>public interface ComparatorAction extends Comparator&lt;Object&gt;, Action { }
  List&lt;ComparatorAction&gt; getThings();
  </code></pre>
  
  <p>But I don't want to have to do this. There's got to be a way to do what I want, right? Any ideas?</p>
  
  <p>Thanks!</p>
  
  <p>P.S. I'm having a tough time coming up with a good title for this post so feel free to change it.</p>