### Question:
IdResource { @GET @Timed @Produces(MediaType.TEXT_PLAIN) @CacheControl(mustRevalidate = true, noCache = true, noStore = true) public String getIdAsString( @HeaderParam(HttpHeaders.USER_AGENT) final String agent) { return String.valueOf(getId(agent)); } IdResource(final IdWorker worker); long getId(final String agent); @GET @Timed @Produces(MediaType.TEXT_PLAIN) @CacheControl(mustRevalidate = true, noCache = true, noStore = true) String getIdAsString(
            @HeaderParam(HttpHeaders.USER_AGENT) final String agent); @GET @Timed @JSONP(callback = "callback", queryParam = "callback") @Produces({ MediaType.APPLICATION_JSON, MediaTypeAdditional.APPLICATION_JAVASCRIPT }) @CacheControl(mustRevalidate = true, noCache = true, noStore = true) Id getIdAsJSON(
            @HeaderParam(HttpHeaders.USER_AGENT) final String agent); @GET @Timed @Produces(ProtocolBufferMediaType.APPLICATION_PROTOBUF) @CacheControl(mustRevalidate = true, noCache = true, noStore = true) SnowizardResponse getIdAsProtobuf(
            @HeaderParam(HttpHeaders.USER_AGENT) final String agent,
            @QueryParam("count") final Optional<IntParam> count);  }### Answer:
@Test public void testGetIdAsString() throws Exception { final long expected = 100L; when(worker.getId(AGENT)).thenReturn(expected); final Response response = resources.client().target("/") .request(MediaType.TEXT_PLAIN) .header(HttpHeaders.USER_AGENT, AGENT).get(); final String entity = response.readEntity(String.class); final long actual = Long.valueOf(entity); assertThat(response.getStatus()).isEqualTo(200); assertThat(actual).isEqualTo(expected); verify(worker).getId(AGENT); }