private void verifyUserMetadataHeaders(JSONObject expectedHeaders, MockRestResponseChannel restResponseChannel)
      throws JSONException {
    Iterator itr = expectedHeaders.keys();
    while (itr.hasNext()) {
      String key = (String) itr.next();
      if (key.startsWith(RestUtils.Headers.USER_META_DATA_HEADER_PREFIX)) {
        String outValue = restResponseChannel.getHeader(key);
        assertEquals("Value for " + key + " does not match in user metadata", expectedHeaders.getString(key), outValue);
      }
    }
  }
Verifies User metadata headers from output, to that sent in during input
@param expectedHeaders the expected headers in the response.
@param restResponseChannel the {@link RestResponseChannel} which contains the response.
@throws JSONException
ambry-frontend/src/test/java/com/github/ambry/frontend/FrontendRestRequestServiceTest.java