title: How do I get a value greater than a specified value in rest assured
body: <p>I am a newbie to Rest-Assured api using Java. I want to extract the number of days the temperature of a city is above 18 . Using openweathermap.org.</p>
  
  <p>The url is api.openweathermap.org/data/2.5/forecast?q=Sydney&amp;units=metric&amp;appid={APP KEY}</p>
  
  <p>I get :</p>
  
  <blockquote>
    <p>{
        "cod": "200",
        "message": 0.0067,
        "cnt": 40,
        "list": [
            {
                "dt": 1557727200,
                "main": {
                    "temp": 20.88,
                    "temp_min": 20.88,
                    "temp_max": 21.05,
                    "pressure": 1025.56,
                    "sea_level": 1025.56,
                    "grnd_level": 1021.14,
                    "humidity": 57,
                    "temp_kf": -0.17
                },
                "weather": [
                    {
                        "id": 803,
                        "main": "Clouds",
                        "description": "broken clouds",
                        "icon": "04d"
                    }
                ],
                "clouds": {
                    "all": 55
                },
                "wind": {
                    "speed": 3.45,
                    "deg": 43.754
                },
                "sys": {
                    "pod": "d"
                },
                "dt_txt": "2019-05-13 06:00:00"
            },
            {
                "dt": 1557738000,
                "main": {
                    "temp": 18.45,
                    "temp_min": 18.45,
                    "temp_max": 18.58,
                    "pressure": 1026.06,
                    "sea_level": 1026.06,
                    "grnd_level": 1021.28,
                    "humidity": 73,
                    "temp_kf": -0.13
                },
                "weather": [
                    {
                        "id": 804,
                        "main": "Clouds",
                        "description": "overcast clouds",
                        "icon": "04n"
                    }
                ],
                "clouds": {
                    "all": 100
                },
                "wind": {
                    "speed": 3.84,
                    "deg": 28.267
                },
                "sys": {
                    "pod": "n"
                },
                "dt_txt": "2019-05-13 09:00:00"
            },  {
                "dt": 1557759600,
                "main": {
                    "temp": 14.31,
                    "temp_min": 14.31,
                    "temp_max": 14.35,
                    "pressure": 1026.29,
                    "sea_level": 1026.29,
                    "grnd_level": 1021.87,
                    "humidity": 80,
                    "temp_kf": -0.04
                },
                "weather": [
                    {
                        "id": 802,
                        "main": "Clouds",
                        "description": "scattered clouds",
                        "icon": "03n"
                    }
                ],
                "clouds": {
                    "all": 28
                },
                "wind": {
                    "speed": 1.66,
                    "deg": 279.19
                },
                "sys": {
                    "pod": "n"
                },
                "dt_txt": "2019-05-13 15:00:00"
            },</p>
  </blockquote>
  
  <p>}</p>
  
  <p>I am unsure how do i proceed with the iterations. It would be a great help if someone can help me through.</p>
  
  <p>I am able to get the data but not sure how do I get the element from each array</p>
  
  <p>Now, I want to extract the temperatures which are above 18 degrees</p>
  
  <p>I have attempted the below:</p>
  
  <pre class="lang-java prettyprint-override"><code>
  public class WeatherForecast {
  
      public static Response resp;
  
      @Test
      public void getWeatherForecastForCity()
      {
          RestAssured.baseURI = "https://api.openweathermap.org";
  
  
  
          resp = given().
                 param("q", "Sydney").
                 param("units", "metric").
                 param("appid", "670473f82ba0969a884be548c75236a4").
          when().
                  get("/data/2.5/forecast").
          then().
                  extract().response();
  
          List&lt;String&gt; temperatures = resp.getBody().jsonPath().getList("list");
          //String value = temperatures.getString()
          int count = temperatures.size();
          for(int i=0;i&lt;=count;i++)
  
          {
  
          }
          System.out.println("List Size: "+temperatures.size());
  
          //assertEquals(temperatures, greaterThanOrEqualTo(20.00F));
  
          //String responseString = resp.asString();
          //System.out.println("Response String: "+responseString);
          //JsonPath js = new JsonPath(responseString);
  
          //Get the number of records for the city
          //int size = js.getList("list").size();
          //int temperature = Integer.parseInt(js.get("count"));
          //System.out.println("Temperature Value: "+js.getString("list[1].main.temp"));
  
      }
  
  }
  
  </code></pre>