title: Convert java.util.Collections to Integer array
body: <p>When I run my code I get the following error:</p>
  
  <pre><code>Caused by: java.lang.ClassCastException: java.util.Collections$UnmodifiableSet cannot be cast to [Ljava.lang.Integer;
  </code></pre>
  
  <p>The code that causes is:</p>
  
  <pre><code>Integer[] selects = (Integer[]) tbl_analytes.getValue();
  </code></pre>
  
  <p>But when I do this:</p>
  
  <pre><code>Object obj = tbl_analytes.getValue();
  System.out.println(obj);
  </code></pre>
  
  <p>I get the following output:</p>
  
  <blockquote>
    <p>[1,7,15]</p>
  </blockquote>
  
  <p>I don't understand why I can't convert this to an <code>Integer[]</code>. Any tips?</p>