What is the efficient way to get the fields from this JSON object?
<p>I've the following code that returns json object. And I need to filter sender email, subject, and creationDate. The code does the job but I felt like there is an efficient way to do it. I appreciate your suggestion.</p>

<pre><code>ResponseEntity&lt;String&gt; response =
                            restTemplate.exchange(app.getResourceUrl() + personnelEmail+
                            MESSAGE+"/?$select=Sender,Subject,CreatedDateTime", HttpMethod.GET, request, String.class);

                    String str=response.getBody();
                    JSONObject jsonObject= new JSONObject(str);
                    JSONArray arrayList= (JSONArray)jsonObject.get("value");

                    List l=arrayList.toList();

                    for(int i=0;i&lt;l.size();i++){
                        HashMap&lt;String,HashMap&gt; hashMap=(HashMap&lt;String,HashMap&gt;)l.get(i);

                        HashMap&lt;String,HashMap&gt; sender= hashMap.get("sender");
                        HashMap&lt;String,String&gt; senderEmail= sender.get("emailAddress");

                        String email= senderEmail.get("address");

                    }
</code></pre>

<p>Here is the json object I receive from MS Office API.</p>

<blockquote>
  <p>{"@odata.context":"<a href="https://graph.microsoft.com/v1.0/" rel="nofollow">https://graph.microsoft.com/v1.0/</a>$metadata#users('user34.onmicrosoft.com')/messages(sender,subject,createdDateTime)","value":[{"@odata.etag":"W/\”sljkasfdiou7978klosadf\"","id”:"lkjasdfu97978KLJASDFS_WGHJJ76J897DKdcuvtymBTItq836K34PUAAAvoK3SAAA=","createdDateTime":"2016-08-27T04:07:08Z","subject":"View
  your Office 365 Enterprise E3 billing
  statement","sender":{"emailAddress":{"name":"Microsoft Online Services
  Team","address”:"T45763@email.microsoftonline.com"}}},{"@odata.etag":"W/\”JUU70303\"","id”:”UEYO93988FK;O38GV3J884=","createdDateTime":"2016-08-26T15:28:47Z","subject":"Order
  confirmation: Thank you for your
  purchase","sender":{"emailAddress":{"name":"Microsoft Online Services
  Team","address":"obue733@email.microsoftonline.com"}}},{"@odata.etag":"W/\”LJKOIU987983\"","id”:”ladjksflk83l.x8783LKFW3=","createdDateTime":"2016-06-24T03:03:26Z","subject":"Attention:
  Your Microsoft Azure Active Directory Premium trial subscription will
  be disabled soon","sender":{"emailAddress":{"name":"Microsoft Online
  Services Team","address":"635cdeee@email.microsoftonline.com"}}}]}</p>
</blockquote>