title: How to separate parameters with same name from json
body: <p>I know that here is so many questions with String to JsonObject conversion but I cant find working solution. I am using java 17. I would like to get data from an API and split these two value into two separate parameters. I have a problem with both values ​​having the same name and they are in the same array. Here is my JSON and code</p>
  <pre><code>{
  &quot;name&quot;: &quot;Fear and Greed Index&quot;,
  &quot;data&quot;: [
      {
          &quot;value&quot;: &quot;49&quot;,
          &quot;value_classification&quot;: &quot;Neutral&quot;,
          &quot;timestamp&quot;: &quot;1633219200&quot;,
          &quot;time_until_update&quot;: &quot;37615&quot;
      },
      {
          &quot;value&quot;: &quot;54&quot;,
          &quot;value_classification&quot;: &quot;Neutral&quot;,
          &quot;timestamp&quot;: &quot;1633132800&quot;
      }
  ],
  &quot;metadata&quot;: {
      &quot;error&quot;: null
  }
  </code></pre>
  <p>}</p>
  <pre><code>private RestTemplate restTemplate = new RestTemplate();
  private static final String FANG_URL = &quot;https://api.alternative.me/fng/?limit=2&quot;;
  
  public FangDto getFangFromLastTwoDays() throws ParseException {
      String response = restTemplate.getForObject(FANG_URL, String.class);
  
      JSONParser parser = new JSONParser();
      JSONObject jsonObj = (JSONObject) parser.parse(response);
  
      Object z = jsonObj.get(&quot;value&quot;);
  </code></pre>