title: Single instance of DataProvider to link to multiple test methods with selective data read
body: <p>Scenario:
  I have built a testNG class which contains multiple test methods + an excel read method.I wish to put All the test methods to Iteration depending upon the no of rows in the excel sheet.
  Also I wish to selectively utilize the data values amongst test methods. ie 
  all column 1 values to be used in test 1 only..
  all col 2 values to be used in test 2 only.. so on..</p>
  
  <p>I do not think this is possible through a single instance of DataProvider which is something I wish for.</p>
  
  <p>Any help appreciated.</p>
  
  <p>FYI I am pasting my Programming logic here:</p>
  
  <p>My Programming Code:
          public class sample {</p>
  
  <pre><code>@DataProvider(name = "dp")
  public static Object[][] readExcel() {
      .
  .
  .
  .
   return data;
  }
  
  @Test(dataProvider = "dp")    
  public void test1(String a,String b) throws Exception {
  System.out.println("test 1 OUTPUT IS "+ a);
      }
  
  @Test(dataProvider = "dp")    
  public void test2(String a,String b) throws Exception {
  System.out.println("test 1 OUTPUT IS "+ b);
      }
  }
  </code></pre>
  
  <hr>
  
  <p>{Data in excel :
      Row 1: sam    miller
      Row 2: peter    paul</p>
  
  <p>Output (presently coming):
      test 1 OUTPUT IS sam;
      test 1 OUTPUT IS peter;
      test 2 OUTPUT IS miller;
      test 2 OUTPUT IS paul;</p>
  
  <p>Output (that is required):
      test 1 OUTPUT IS sam;
      test 2 OUTPUT IS miller;
      test 1 OUTPUT IS peter; 
      test 2 OUTPUT IS paul;
  }</p>