title: Rest Assured execption class io.restassured.path.xml.XmlPath cannot be cast to class java.util.ArrayList error
body: <p>Im working on Rest Assured project and I want to get speciific part of response body
  but Im getting exception:</p>
  <pre><code>Exception in thread &quot;main&quot; java.lang.ClassCastException: class io.restassured.path.xml.XmlPath cannot be cast to class java.util.ArrayList (io.restassured.path.xml.XmlPath is in unnamed module of loader 'app'; java.util.ArrayList is in module java.base of loader 'bootstrap')
  </code></pre>
  <p>The code is taken from tutorial website so it should works correctly. Can anyone help?</p>
  <pre><code> public static void getSpecificPartOfResponseBody(){
          ArrayList&lt;String&gt; amounts = when().get(url).then().extract().path(&quot;result.statements.AMOUNT&quot;) ;
          int sumOfAll=0;
          for(String a:amounts){
  
              System.out.println(&quot;The amount value fetched is &quot;+a);
              sumOfAll=sumOfAll+Integer.valueOf(a);
          }
          System.out.println(&quot;The total amount is &quot;+sumOfAll);
  
  }
  </code></pre>
  <p>response body:</p>
  <pre><code>{&quot;result:&quot;:{&quot;statements&quot;:[{&quot;TRANSACTION_ID&quot;:&quot;12&quot;,&quot;ACCOUNT_NO&quot;:&quot;1&quot;,&quot;DATE_OF_TRANSACTION&quot;:&quot;2013-11-16&quot;,&quot;AMOUNT&quot;:&quot;500&quot;,&quot;TRANSACTION_TYPE&quot;:&quot;D&quot;,&quot;DESCRIPTION&quot;:&quot;Initial Deposit&quot;},{&quot;TRANSACTION_ID&quot;:&quot;23&quot;,&quot;ACCOUNT_NO&quot;:&quot;1&quot;,&quot;DATE_OF_TRANSACTION&quot;:&quot;2013-11-17&quot;,&quot;AMOUNT&quot;:&quot;14&quot;,&quot;TRANSACTION_TYPE&quot;:&quot;t&quot;,&quot;DESCRIPTION&quot;:&quot;yi Tansfer From 14&quot;},{&quot;TRANSACTION_ID&quot;:&quot;25&quot;,&quot;ACCOUNT_NO&quot;:&quot;1&quot;,&quot;DATE_OF_TRANSACTION&quot;:&quot;2013-11-18&quot;,&quot;AMOUNT&quot;:&quot;1&quot;,&quot;TRANSACTION_TYPE&quot;:&quot;t&quot;,&quot;DESCRIPTION&quot;:&quot;hgg Tansfer From 15&quot;},{&quot;TRANSACTION_ID&quot;:&quot;49745&quot;,&quot;ACCOUNT_NO&quot;:&quot;1&quot;,&quot;DATE_OF_TRANSACTION&quot;:&quot;2017-04-13&quot;,&quot;AMOUNT&quot;:&quot;0&quot;,&quot;TRANSACTION_TYPE&quot;:&quot;t&quot;,&quot;DESCRIPTION&quot;:&quot;0 Tansfer From 1&quot;},{&quot;TRANSACTION_ID&quot;:&quot;94867&quot;,&quot;ACCOUNT_NO&quot;:&quot;1&quot;,&quot;DATE_OF_TRANSACTION&quot;:&quot;2018-11-21&quot;,&quot;AMOUNT&quot;:&quot;500&quot;,&quot;TRANSACTION_TYPE&quot;:&quot;t&quot;,&quot;DESCRIPTION&quot;:&quot;cash Tansfer From 14&quot;}]},&quot;message&quot;:{&quot;ErrorCode:&quot;:0,&quot;ErrorMsg:&quot;:&quot;Success&quot;}}
  </code></pre>