title: Rest Assured: extract value from Response List
body: <p>I have a List returned as response. I need to get one item from list using product.name and tariffPlan.name.</p>
  
  <pre><code>    [
    {
      "id": 123,
      "product": {
        "id": 1,
        "code": "credit",
        "name": "Credit"
      },
      "tariffPlan": {
        "id": 1,
        "code": "gold",
        "name": "Gold"
      }
    },
    {
      "id": 234,
      "product": {
        "id": 2,
        "code": "debit",
        "name": "Debit"
      },
      "tariffPlan": {
        "id": 1,
        "code": "gold",
        "name": "Gold"
      }
    }
  ]
  </code></pre>
  
  <p>I use Java8. Here is my method. I got List of Card.class elements. And then I need to get single Item from list with specified "product.name" and "tariffPlan.name". </p>
  
  <pre><code>public List&lt;Card&gt; getCardId(String productName, String tariffPlanName) {
      return given()
          .param("product.name", productName)
          .param("tariffPlan.name", tariffPlanName)
          .when().get("/").then()
          .extract().jsonPath().getList("", Card.class);
    }
  </code></pre>
  
  <p>Is it possible to do it with restAssured? Maybe use .param method like in my example? But in my example .param method is ignored. Thank you for your ideas.</p>
  
  <p>UPD. My decision is:</p>
  
  <pre><code> public Card getCard(String productName, String tariffPlanName) {
      List&lt;Card&gt; cardList = given()
          .when().get("/").then()
          .extract().jsonPath().getList("", Card.class);
  
      return cardList.stream()
          .filter(card -&gt; card.product.name.equals(productName))
          .filter(card -&gt; card.tariffPlan.name.equals(tariffPlanName))
          .findFirst()
          .get();
    }
  </code></pre>