@Override
    public boolean removeExistingSetCookie(String cookieName) {
        String cookieNamePrefix = cookieName + "=";
        boolean dirty = false;
        Headers filtered = new Headers();
        for (Header hdr : getHeaders().entries()) {
            if (HttpHeaderNames.SET_COOKIE.equals(hdr.getName())) {
                String value = hdr.getValue();

                // Strip out this set-cookie as requested.
                if (value.startsWith(cookieNamePrefix)) {
                    // Don't copy it.
                    dirty = true;
                } else {
                    // Copy all other headers.
                    filtered.add(hdr.getName(), hdr.getValue());
                }
            } else {
                // Copy all other headers.
                filtered.add(hdr.getName(), hdr.getValue());
            }
        }

        if (dirty) {
            setHeaders(filtered);
        }
        return dirty;
    }
@Test
    void testRemoveExistingSetCookie() {
        response.getHeaders()
                .add(
                        "Set-Cookie",
                        "c1=1234; Max-Age=-1; Expires=Tue, 01 Sep 2015 22:49:57 GMT; Path=/; Domain=.netflix.com");
        response.getHeaders()
                .add(
                        "Set-Cookie",
                        "c2=4567; Max-Age=-1; Expires=Tue, 01 Sep 2015 22:49:57 GMT; Path=/; Domain=.netflix.com");

        response.removeExistingSetCookie("c1");

        assertEquals(1, response.getHeaders().size());
        assertFalse(response.hasSetCookieWithName("c1"));
        assertTrue(response.hasSetCookieWithName("c2"));
    }