### Question:
MyResource { @GET public String getFruit() { String clientHeaderValue = headers.getHeaderString("clientHeader"); String serverHeaderValue = headers.getHeaderString("serverHeader"); if (clientHeaderValue != null && clientHeaderValue.equals("clientHeaderValue") && serverHeaderValue != null && serverHeaderValue.equals("serverHeaderValue")) { return "apple"; } else { return "banana"; } }  @GET String getFruit(); @POST @Consumes(value = "*/*") @Produces("text/plain") String echoFruit(String fruit);  }### Answer:
@Test public void testGetFruit() { String result = target.request().get(String.class); assertEquals("Likely that the headers set in the filter were not available in endpoint", "apple", result); }