Java Sets - get the type of contained items
<p>I get a set of elements passed to my method without the type specified.</p>

<p>I want to find out what the class of the contained elements is... I know they're all of the same type.</p>

<p>Tried:</p>

<pre><code>Class c = set.getClass.getComponentClass();
</code></pre>

<p>But that probably doesnt work because it's just for Array collections.</p>
