### Question:
LocalizationBundleJaxrsService { @GET @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) public Response getBundle(@PathParam("name") String bundleName, @Context HttpHeaders headers, @Context Request request) { Locale locale = headers.getAcceptableLanguages().get(0); Map<String, String> messages = messageSource.getAllMessagesForBaseName(bundleName, locale); EntityTag etag = generateETag(toJson(messages)); Response.ResponseBuilder response = request.evaluatePreconditions(etag); if (response == null) { response = messages.isEmpty() ? Response.noContent() : Response.ok(messages); } return response.tag(etag).build(); }  @Resource(name = "bundlePathsList") void setBundleNames(List<String> bundlePathsList); @GET @Produces(MediaType.APPLICATION_JSON) Response getBundles(@QueryParam(RestConstants.QUERY_PARAM_EXPANDED) Boolean expanded,
                               @Context HttpHeaders headers, @Context Request request, @Context HttpServletRequest httpRequest); @GET @Path("/{name}") @Produces(MediaType.APPLICATION_JSON) Response getBundle(@PathParam("name") String bundleName, @Context HttpHeaders headers, @Context Request request); byte[] toJson(Map<String, String> messages);  }### Answer:
@Test(dependsOnMethods = "setBundleNames") public void getBundle() { assertSame(service.getBundle(BUNDLE1_NAME, httpHeaders, request).getEntity(), bundle1); assertSame(service.getBundle(BUNDLE2_NAME, httpHeaders, request).getEntity(), bundle2); assertSame(service.getBundle(BUNDLE3_NAME, httpHeaders, request).getEntity(), bundle3); assertSame(service.getBundle(BUNDLE4_NAME, httpHeaders, request).getEntity(), bundle4); }