Object[] to Class[] in Java
<p>Is there any built-in Java6 method (perhaps in lang or reflection?) for performing:</p>

<pre><code>private Class[] getTypes(final Object[] objects) {
    final Class[] types = new Class[objects.length];
    for (int i = 0; i &lt; objects.length; i++) {
        types[i] = objects[i].getClass();
    }
    return types;
}
</code></pre>

<p>Which takes an Object array and returns an array containing the type of each element?</p>
