title: How to compare two jsonPath values in MockMvc
body: <p>I am writing tests for my spring application using MockMvc. Assume that my json result will have the following format:</p>
  
  <pre><code>{
    "available": true,
    "location": [
      {"ID": 1, "path": "local1"},
      {"ID": 2, "path": "local2"},
      {"ID": 3, "path": "local3"}
      ],
    "firstItem": "local1"
  }
  </code></pre>
  
  <p>And I would like to test that if the value of the <code>$.firstItem</code> property will equal to the <code>$.location[0].path</code> or not, actually they are should be equal. Which expectation should I put in the third expect below?</p>
  
  <pre><code>mockMvc.perform(get(url))
                  .andExpect(jsonPath("$.available", equalTo(true)))
                  .andExpect(jsonPath("$.location", hasSize(3)))
                  .andExpect(jsonPath("$.firstItem", ????));
  </code></pre>
  
  <p>Thank you very much for your help!</p>