public static QueryableRequestSpecification query(RequestSpecification specification) {
        if (specification instanceof QueryableRequestSpecification) {
            return (QueryableRequestSpecification) specification;
        }
        throw new IllegalArgumentException("Cannot convert " + specification + " to a " + QueryableRequestSpecification.class.getName());
    }
@Test public void
    specification_querier_allows_querying_request_specifications() {
        // Given
        RequestSpecification spec = new RequestSpecBuilder().addHeader("header", "value").addCookie("cookie", "cookieValue").addParam("someparam", "somevalue").build();

        // When
        QueryableRequestSpecification queryable = SpecificationQuerier.query(spec);

        // Then
        softly.assertThat(queryable.getHeaders().getValue("header")).isEqualTo("value");
        softly.assertThat(queryable.getCookies().getValue("cookie")).isEqualTo("cookieValue");
        softly.assertThat(queryable.getRequestParams().get("someparam")).isEqualTo("somevalue");
    }