ib = target.request("*/*");
ib.header("custom-header", "custom-value");
ib.header("content-encoding", "deflate");
i = ib.build("POST", Entity.entity("aaa", MediaType.WILDCARD_TYPE));
r = i.invoke();
reqHeaders = r.readEntity(String.class).toLowerCase();
for (final String expected : new String[] {"custom-header:[custom-value]", "custom-header:custom-value"}) {
assertTrue(String.format("Request headers do not contain expected '%s' entry:\n%s", expected, reqHeaders),
reqHeaders.contains(expected));