title: Json file as data provider in TestNG
body: <p>Give below is my JSON structure:
  I want to write a method in Java that should take only SuperParent as input parameter and return "Registration Data" and "Registration Data1" along with their child elements as TestNG dataprovider object. </p>
  
  <pre><code>"SuperParent":
  {
      "Registration Data" : 
          {
              "FirstName"   : "Aditya Kumar",
              "LastName"    : "Roy",
              "Phone"       : "7589698874",
              "Email"       : "aditya@test.com"
          },
      "Registration Data1" :
          {
              "FirstName"   : "Preety",
              "LastName"    : "Kakkar",
              "Phone"       : "2225556669",
              "Email"       : "preety@test.com"
          }
    }
  </code></pre>
  
  <p>I have written below code but its throwing Dataprovider mismatch exception</p>
  
  <pre><code>public static Object[][] getTest(String regionName) 
  { 
      JsonParser jsonParser =  new JsonParser();
      JsonObject jsonObj = jsonParser.parse(new FileReader(JSONpath)).getAsJsonObject();
      JsonObject region =jsonObj.getAsJsonObject(regionName);
      Object[][] returnData = new Object[100][region.size()];
      int j = 0;
      for (Map.Entry&lt;String, JsonElement&gt; entry : region.getAsJsonObject().entrySet()) 
      {
  
          returnData[0][j] = (region.toString());
          j++;   
     }
      return returnData;
  }
  
      FAILED: userRegistration
  org.testng.internal.reflect.MethodMatcherException: 
  Data provider mismatch
  Method: userRegistration([Parameter{index=0, type=java.lang.String, declaredAnnotations=[]}, Parameter{index=1, type=java.lang.String, declaredAnnotations=[]}, Parameter{index=2, type=java.lang.String, declaredAnnotations=[]}, Parameter{index=3, type=java.lang.String, declaredAnnotations=[]}])
  Arguments: [(java.lang.String) {FirstName:Aditya Kumar,LastName:Roy,Phone:7589698874,Email:aditya@test.com},(java.lang.String) {FirstName:Preety,LastName:Kakkar,Phone:2225556669,Email:preety@test.com}]
      at org.testng.internal.reflect.DataProviderMethodMatcher.getConformingArguments(DataProviderMethodMatcher.java:45)
      at org.testng.internal.Parameters.injectParameters(Parameters.java:796)
      at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:983)
      at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
      at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
      at org.testng.TestRunner.privateRun(TestRunner.java:648)
      at org.testng.TestRunner.run(TestRunner.java:505)
      at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
      at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
      at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
      at org.testng.SuiteRunner.run(SuiteRunner.java:364)
      at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
      at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
      at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
      at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
      at org.testng.TestNG.runSuites(TestNG.java:1049)
      at org.testng.TestNG.run(TestNG.java:1017)
      at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:114)
      at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:251)
      at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:77)
  </code></pre>