title: Ambiguous Method call in Java with Generic VarArgs
body: <p>I'm getting a compile error <code>The method getRecommendedIds(String, Object&amp;Comparable&lt;?&gt;&amp;Serializable[]) is ambiguous for the type MyService</code> when trying to call an overloaded method that uses generics and varargs.</p>
  
  <p>The service:</p>
  
  <pre><code>public interface MyService {
      public &lt;K&gt; List&lt;K&gt; getRecommendedIds(String datasource, K... ids);
      public &lt;K&gt; List&lt;K&gt; getRecommendedIds(String datasource, int limit, K... ids);
  }
  </code></pre>
  
  <p>The call:</p>
  
  <pre><code>@Test(expected = NullPointerException.class)
  public void testGetWithLimitThrowsNpeForNullDatasource() {
      service.getRecommendedIds(null, 3, UUID.randomUUID());
  }
  </code></pre>
  
  <p>Is there any way around this?</p>