/**
* Assert request header values with the given Hamcrest matcher.
*/
@SuppressWarnings("unchecked")
public static RequestMatcher header(final String name, final Matcher<? super String>... matchers) {
return new RequestMatcher() {
@Override
public void match(ClientHttpRequest request) {
assertHeaderValueCount(name, request.getHeaders(), matchers.length);
for (int i = 0 ; i < matchers.length; i++) {
assertThat("Request header", request.getHeaders().get(name).get(i), matchers[i]);