title: Why doesn't Java varargs support collections?
body: <p>In my Java code I often use the very handy <code>method(Class... args)</code> varargs. As far as I know, they allow you to pass any amount of <code>Class</code> objects or an array of <code>Class[]</code>. Since I also often use the Java collection classes, I am frustrated by the lack of compatibility between both. As a result, I end up doing <code>collection.toArray()</code>, but that has some type safety issues.</p>
  
  <p>So now for the question: why doesn't Java allow instances of <code>Iterable&lt;T&gt;</code> as vararg arguments, as long as the generic type fits the <code>T...</code> type of the vararg? Doesn't everyone use lists, sets, etc. all the time? Is there an easy, type-safe way to provide the conversion from collection to vararg?</p>