title: How to call method with Object... as parameter
body: <p>I wonder how can I call a class method which are expecting Object...(Object[])
  as parameter.</p>
  
  <p>I can't know at compilation time now many parameters I need to pass to it,
  so I can't do like <code>somemethod(1,2,3,4,5)</code>.</p>
  
  <p>I'm doing big construction like:</p>
  
  <pre><code>if (param.lengts()==5) {
  somemethod(1,2,3,4,5);
  } elseif (param.lengts()==4) 
  somemethod(1,2,3,4);
  ....
  </code></pre>
  
  <p>I was trying to pass <code>List&lt;&gt;</code> and <code>ArrayList&lt;&gt;</code> but without success.
  Is there a simple way how to convert my dynamic array to the method? I can't change method constructor.</p>
  
  <p>Problem about to call the method, not with declare or read parameters inside the method.</p>