// Path: core/src/main/java/io/appflate/restmock/utils/RequestMatchers.java
// public static RequestMatcher hasHeaderNames(final String... headerNames) {
//     return new RequestMatcher("has headers: " + Arrays.toString(headerNames)) {
// 
//         @Override
//         protected boolean matchesSafely(RecordedRequest item) {
//             if (headerNames == null) {
//                 throw new IllegalArgumentException("You did not specify any header names");
//             }
//             if (headerNames.length > 0 && item.getHeaders() == null) {
//                 return false;
//             }
//             for (String header : headerNames) {
//                 if (item.getHeader(header) == null) {
//                     return false;
//                 }
//             }
//             return true;
//         }
//     };
// }


import java.util.Collections;
import okio.Buffer;
import org.junit.Test;
import org.mockito.Mockito;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import okhttp3.Headers;
import okhttp3.mockwebserver.RecordedRequest;
import static io.appflate.restmock.utils.RequestMatchers.hasHeaderNames;
import static junit.framework.Assert.assertFalse;
import static junit.framework.TestCase.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
    @Test
    public void shouldMatchProperSubsetOfQueryParametersNames() throws IOException {
        // given
        RecordedRequest recordedRequest = createRecordedRequest("/foo/?bar=bar&baz=baz&boo=boo");

        // when
        RequestMatcher matcher = RequestMatchers.hasQueryParameterNames("bar", "baz");

        // then
        assertTrue(matcher.matches(recordedRequest));
    }

    @Test
    public void shouldNotMatchInproperSubsetOfQueryParametersNames() throws IOException {
        // given
        RecordedRequest recordedRequest = createRecordedRequest("/foo/?bar=bar&baz=baz&boo=boo");

        // when
        RequestMatcher matcher = RequestMatchers.hasQueryParameterNames("bar", "ban");

        // then
        assertFalse(matcher.matches(recordedRequest));
    }

    @Test
    public void hasHeaderNamesFailWhenNoHeaders() {
        //given
        RecordedRequest request = createRecordedRequest("/path");

        //when
// Path: core/src/main/java/io/appflate/restmock/utils/RequestMatchers.java
// public static RequestMatcher hasHeaderNames(final String... headerNames) {
//     return new RequestMatcher("has headers: " + Arrays.toString(headerNames)) {
// 
//         @Override
//         protected boolean matchesSafely(RecordedRequest item) {
//             if (headerNames == null) {
//                 throw new IllegalArgumentException("You did not specify any header names");
//             }
//             if (headerNames.length > 0 && item.getHeaders() == null) {
//                 return false;
//             }
//             for (String header : headerNames) {
//                 if (item.getHeader(header) == null) {
//                     return false;
//                 }
//             }
//             return true;
//         }
//     };
// }


// Path: core/src/test/java/io/appflate/restmock/utils/RequestMatchersTest.java
import java.util.Collections;
import okio.Buffer;
import org.junit.Test;
import org.mockito.Mockito;
import java.io.IOException;
import java.net.InetAddress;
import java.net.Socket;
import okhttp3.Headers;
import okhttp3.mockwebserver.RecordedRequest;
import static io.appflate.restmock.utils.RequestMatchers.hasHeaderNames;
import static junit.framework.Assert.assertFalse;
import static junit.framework.TestCase.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

    @Test
    public void shouldMatchProperSubsetOfQueryParametersNames() throws IOException {
        // given
        RecordedRequest recordedRequest = createRecordedRequest("/foo/?bar=bar&baz=baz&boo=boo");

        // when
        RequestMatcher matcher = RequestMatchers.hasQueryParameterNames("bar", "baz");

        // then
        assertTrue(matcher.matches(recordedRequest));
    }

    @Test
    public void shouldNotMatchInproperSubsetOfQueryParametersNames() throws IOException {
        // given
        RecordedRequest recordedRequest = createRecordedRequest("/foo/?bar=bar&baz=baz&boo=boo");

        // when
        RequestMatcher matcher = RequestMatchers.hasQueryParameterNames("bar", "ban");

        // then
        assertFalse(matcher.matches(recordedRequest));
    }

    @Test
    public void hasHeaderNamesFailWhenNoHeaders() {
        //given
        RecordedRequest request = createRecordedRequest("/path");

        //when
        RequestMatcher matcher = hasHeaderNames("header1");