title: Convert List<T> to Collection<Object[]> for JUnit Parametrized Test
body: <p>I would like to perform a JUnit Parametrized test with data being external.
  I have a list of objects and just need to know how I can convert that to a collection of object arrays. I see the below stack overflow question, but I want to add data from a file which is read from my method.</p>
  
  <p><a href="https://stackoverflow.com/questions/9215304/parameterized-junit-tests-with-non-primitive-parameters">Parameterized JUnit tests with non-primitive parameters?</a></p>
  
  <p>Working code: something like this:</p>
  
  <pre><code>@RunWith(Parameterized.class)
  public class sampletest {
  
    private BranchMailChildSample branch;
  
    public sampletest(BranchMailChildSample branch)
    {
      this.branch = branch;
    }
  
    @Parameters
    public static Collection&lt;Object[]&gt; data()
    {
      String excel = "C:\\Resources\\TestData\\ExcelSheets\\BranchMail\\branchmail_TestData.xlsx";
      ExcelMarshallerTool tool = new ExcelMarshallerTool(excel);
      List&lt;BranchMailChildSample&gt; items = tool.unmarshallExcel(BranchMailChildSample.class);
  
     //RIGHT HERE I NEED HELP: Convert list to Collection&lt;Object[]&gt;
  
      //return items as Collection of object arrays 
    }
  
    @Test
    public void test()
    {
      System.out.println(branch.toString());
    }
  }
  </code></pre>