TestNG : How to return List<String> from DataProvider method
<p>I am quite new to TestNG.</p>

<p>Following is my test method</p>

<pre><code>@Test(dataProvider="getHRServiceData")
public void executeHRService(List&lt;String&gt; inputValues)
{
    //some code here
}
</code></pre>

<p>As you can see this method requires List inputValues as argument.</p>

<p>Following is my code for getHRServiceData() method</p>

<pre><code>public Object[][] getHRServiceData() throws Exception 
{
    List&lt;String&gt; inputValues=Utils.getInputDataFromExcelFileAsList("HR");
    Object[][] objArray  = new Object[inputValues.length][]; 
    //Code to convert List&lt;String&gt; to Object[][]
}
</code></pre>

<p>In this method I get inputValues values in the form of List</p>

<p>But as return type is Object[][] I need to convert List into Object[][] </p>

<p>I am not sure how to convert List into Object[][] </p>

<p>Could you please help me here.</p>