title: Java: Casting Object to Array type
body: <p>I am using a web service that returns a plain object of the type "Object". Debug shows clearly that there is some sort of Array in this object so I was wondering how I can cast this "Object" to an Array (or similar)?</p>
  
  <p>I tried the following:</p>
  
  <pre><code>Collection&lt;String&gt; arr = (Collection&lt;String&gt;) values;
  Vector&lt;String&gt; arr = (Vector&lt;String&gt;) values;
  ArrayList&lt;String&gt; arr = (ArrayList&lt;String&gt;) values;
  </code></pre>
  
  <p>But nothing worked. I always get an InvocationTargetException.</p>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Edit</strong>:</p>
  
  <p>Sadly, I had to remove the link to the image that showed the output of Eclipse's debugger because it was no longer available. Please do not wonder why in the answers an image is mentioned that is not there anymore.</p>