    @Test
    public void testClearHeader() {

        final Client client = ClientBuilder.newClient();
        final Invocation.Builder builder = client.target("http://localhost:8080/mypath").request();
        final JerseyInvocation invocation = (JerseyInvocation) builder
                .header("foo", "bar").header("foo", null).header("bar", "foo")
                .buildGet();
        final MultivaluedMap<String, Object> headers = invocation.request().getHeaders();

        assertThat(headers.size(), is(1));
        assertThat(headers.keySet(), hasItem("bar"));
    }