title: Count the number of Arrays & access a specific array in the JSON Response using REST ASSURED with JAVA & Selenium
body: <p>I am doing a POST call action through my selenium Automation program using Rest Assured API &amp; Java. IO get a response as mentioned below-</p>
  
  <pre><code>{
      "cmsContract": "HA1123",
      "groupId": "12345",
      "siteId": "4444-AP",
      "stateCountyCode": "7978790"
    },
    {
      "cmsContract": "HB2345",
      "groupId": "9876",
      "siteId": "8888-DK",
      "stateCountyCode": "111225"
    }
  </code></pre>
  
  <p>There are about 1000 or more JSON Objects in the response. And they don't have a identifier for the response like "name" or "contractinfo"</p>
  
  <p>My query:
  1. How do I retrieve the total count of the arrays (like one from '<code>{</code>' to '<code>}</code>') using Rest Assured APIs in conjuncture with JAVA and selenium?</p>
  
  <ol start="2">
  <li>If I had to retrieve '<code>stateCountyCode</code>' for the result set with '<code>cmsContract</code>' as <code>HB2345</code> , how would I do that? I would want to see the value return as  <code>111225</code></li>
  </ol>
  
  <p>Please suggest.</p>
  
  <p>Libraries used-</p>
  
  <pre><code>org.json.JSONObject;
  io.restassured.RestAssured;
  io.restassured.response.Response;
  io.restassured.specification.RequestSpecification;
  </code></pre>